mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
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:
parent
becd6cd744
commit
f795e92802
|
|
@ -1108,7 +1108,7 @@ def is_tensor(obj: _Any, /) -> _TypeIs["torch.Tensor"]:
|
||||||
r"""Returns True if `obj` is a PyTorch tensor.
|
r"""Returns True if `obj` is a PyTorch tensor.
|
||||||
|
|
||||||
Note that this function is simply doing ``isinstance(obj, 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
|
and more explicit - so it's recommended to use that instead of
|
||||||
``is_tensor``.
|
``is_tensor``.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user