If the object is a torch Variable, not the plain torch Tensor, using type() method of the object without any argument will cause this error.

TypeError: type() missing 1 required positional argument: ‘t’

But it is not clear what this error message means.