import torch
from monai.transforms.utils_pytorch_numpy_unification import max
a = torch.rand(6, 8, 3)
b = max(a, dim=1)
print(type(b), (isinstance(b, tuple)))
print(b.shape)
<class 'torch.return_types.max'> True
{
"name": "AttributeError",
"message": "'torch.return_types.max' object has no attribute 'shape'",
"stack": "---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[8], line 7
5 b = max(a, dim=1)
6 print(type(b), (isinstance(b, tuple)))
----> 7 print(b.shape)
AttributeError: 'torch.return_types.max' object has no attribute 'shape'"
}