latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.is_tensor
- tensorplay.is_tensor(obj: Any, /) TypeIs[Tensor][source]
Returns True if obj is a TensorPlay tensor.
Note that this function is simply doing
isinstance(obj, Tensor). Using thatisinstancecheck is better for type checking with mypy, and more explicit - so it’s recommended to use that instead ofis_tensor.- Parameters:
obj (object) – Object to test
Example:
>>> x = tensorplay.tensor([1, 2, 3]) >>> tensorplay.is_tensor(x) True
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

