diff --git a/torch/__init__.py b/torch/__init__.py index 34340b51d0e..3dcaaa21bde 100644 --- a/torch/__init__.py +++ b/torch/__init__.py @@ -1108,7 +1108,7 @@ def is_tensor(obj: _Any, /) -> _TypeIs["torch.Tensor"]: r"""Returns True if `obj` is a PyTorch tensor. Note that this function is simply doing ``isinstance(obj, Tensor)``. - Using that ``isinstance`` check is better for typechecking with mypy, + Using that ``isinstance`` check is better for type checking with mypy, and more explicit - so it's recommended to use that instead of ``is_tensor``.