Rasmus Kjær (FearTheOcean)
MModular
•Created by Rasmus Kjær (FearTheOcean) on 9/30/2024 in #questions
Is auth not working for me?
i clicked the authorize but it seems i did not get moved to a new window as the gif in announcements showed. I am using ubuntu os.
6 replies
MModular
•Created by Rasmus Kjær (FearTheOcean) on 9/30/2024 in #questions
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
3 replies