How do i access TensorDict.items?
items(ref [self_is_lifetime] self: Self) -> _DictEntryIter[$0, String, _CheckpointTensor, $1._items, 1
It seems to not act as a regular dict or tensor upon this call. I can really see how i am meant to iterate through it.
this is my current solution;
tensors = load("./checkpoint-test.max")
x = tensors.getDType.int32
y = tensors.getDType.int32
list_of_keys = tensors.keys()
list_of_items = tensors.items()
for item in tensors.items(): print(item[]) for key in list_of_keys: print(key[]) this is the error that is thrown: error: invalid call to 'print': callee with non-empty variadic pack argument expects 0 positional operands, but 1 was specified print(item[]) note: function declared here from max.tensor import Tensor, TensorShape error: failed to parse the provided Mojo source module
for item in tensors.items(): print(item[]) for key in list_of_keys: print(key[]) this is the error that is thrown: error: invalid call to 'print': callee with non-empty variadic pack argument expects 0 positional operands, but 1 was specified print(item[]) note: function declared here from max.tensor import Tensor, TensorShape error: failed to parse the provided Mojo source module
1 Reply
Congrats @Rasmus Kjær (FearTheOcean), you just advanced to level 1!