mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[2/N] Simplify "in" operation for containers of a single item (#164323)
These issues are detected by ruff [FURB171](https://docs.astral.sh/ruff/rules/single-item-membership-test/#single-item-membership-test-furb171). Pull Request resolved: https://github.com/pytorch/pytorch/pull/164323 Approved by: https://github.com/justinchuby, https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
96c3b9e275
commit
cc8b14d09a
@ -815,9 +815,10 @@ def _is_fp(value) -> bool:
|
||||
|
||||
|
||||
def _is_bool(value) -> bool:
|
||||
return _type_utils.JitScalarType.from_value(
|
||||
value, _type_utils.JitScalarType.UNDEFINED
|
||||
) in {_type_utils.JitScalarType.BOOL}
|
||||
return (
|
||||
_type_utils.JitScalarType.from_value(value, _type_utils.JitScalarType.UNDEFINED)
|
||||
== _type_utils.JitScalarType.BOOL
|
||||
)
|
||||
|
||||
|
||||
def _generate_wrapped_number(g: jit_utils.GraphContext, scalar):
|
||||
|
Reference in New Issue
Block a user