space added between type and checking for typechecking (#161352)

space added between type and checking for "typechecking"

Fixes #161282

Pull Request resolved: https://github.com/pytorch/pytorch/pull/161352
Approved by: https://github.com/malfet
This commit is contained in:
RajeshvShiyal 2025-08-26 02:07:33 +00:00 committed by PyTorch MergeBot
parent becd6cd744
commit f795e92802

View File

@ -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``.