Testing is Tensor

The standard way is to use

import torch

torch.is_tensor(x)
1 Like