PyTorch torch.Size object is not callable

Error while calling .shape on a tensor:

my_tensor = list(my_tensor.shape())

Issue: The reason that error is coming is because shape is an attribute and not a function.

The solution is to call it like this:

my_tensor = list(my_tensor.shape)

i.e to call it like property instead of as an object.