bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / _external / array_api_compat / common / _helpers / is_torch_array
function
scipy._external.array_api_compat.common._helpers:is_torch_array
Signature
def is_torch_array(x: object) → TypeIs[torch.Tensor]Summary
Return True if x is a PyTorch tensor.
Extended Summary
This function does not import PyTorch if it has not already been imported and is therefore cheap to use.
See also
Aliases
scipy.differentiate.xpx.testing.is_torch_array