-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
import torch
from monai.data import MetaTensor
data = MetaTensor(torch.zeros([2, 96, 96]))
data.is_batch = True
mask = torch.tensor([True, False])
print(data[mask].shape)Traceback (most recent call last):
File "/Users/Documents/MONAI/my_test_1.py", line 9, in <module>
print(data[mask].shape)
File "/Users/Documents/MONAI/monai/data/meta_tensor.py", line 297, in __torch_function__
ret = MetaTensor.update_meta(ret, func, args, kwargs)
File "/Users/Documents/MONAI/monai/data/meta_tensor.py", line 237, in update_meta
ret_meta = decollate_batch(args[0], detach=False)[batch_idx]
TypeError: only integer tensors of a single element can be converted to an index
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working