diff --git a/torch/__init__.py b/torch/__init__.py index 39555a8360e8..f7fd0210d81f 100644 --- a/torch/__init__.py +++ b/torch/__init__.py @@ -1120,11 +1120,6 @@ def typename(obj: _Any, /) -> str: 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 type checking with mypy, - and more explicit - so it's recommended to use that instead of - ``is_tensor``. - Args: obj (object): Object to test Example::