Is an object a torch tensor?
is_torch_tensor(x)
x
a logical.
library("SpaNorm") is_torch_tensor(matrix(1:4, 2, 2))
[1] FALSE