mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[primTorch] Rename is_finite->isfinite (#78211)
`isfinite` sounds like a better name, because PyTorch, C++, numpy all have this name instead of `is_finite` Pull Request resolved: https://github.com/pytorch/pytorch/pull/78211 Approved by: https://github.com/ngimel, https://github.com/mruberry
This commit is contained in:
committed by
PyTorch MergeBot
parent
92229adf0c
commit
5ecd30e857
@ -139,11 +139,7 @@ ALLOW_LIST = [
|
||||
("aten::_weight_norm_cuda_interface", datetime.date(9999, 1, 1)),
|
||||
("aten::_weight_norm_cuda_interface_backward", datetime.date(9999, 1, 1)),
|
||||
# TODO: FIXME: prims shouldn't be checked
|
||||
("prims::any", datetime.date(9999, 1, 1)),
|
||||
("prims::all", datetime.date(9999, 1, 1)),
|
||||
("prims::empty_like", datetime.date(9999, 1, 1)),
|
||||
("prims::select", datetime.date(9999, 1, 1)),
|
||||
("prims::concatenate", datetime.date(9999, 1, 1)),
|
||||
("prims::.*", datetime.date(9999, 1, 1)),
|
||||
]
|
||||
|
||||
ALLOW_LIST_COMPILED = [
|
||||
|
@ -61,7 +61,7 @@ __all__ = [
|
||||
"exp2",
|
||||
"fill",
|
||||
"floor",
|
||||
"is_finite",
|
||||
"isfinite",
|
||||
"is_infinite",
|
||||
"lgamma",
|
||||
"log",
|
||||
@ -626,8 +626,8 @@ def _isfinite_nvfuser(fd: Any, a: TensorLikeType):
|
||||
return fd.Ops.isfinite(a) # type: ignore[attr-defined]
|
||||
|
||||
|
||||
is_finite = _make_elementwise_unary_prim(
|
||||
"is_finite",
|
||||
isfinite = _make_elementwise_unary_prim(
|
||||
"isfinite",
|
||||
impl_aten=torch.isfinite,
|
||||
impl_nvfuser=_isfinite_nvfuser,
|
||||
doc="",
|
||||
|
@ -437,7 +437,7 @@ frac = _make_elementwise_unary_reference(
|
||||
|
||||
def _isfinite(a: TensorLikeType) -> TensorLikeType:
|
||||
if utils.is_float_dtype(a.dtype) or utils.is_complex_dtype(a.dtype):
|
||||
return prims.is_finite(a)
|
||||
return prims.isfinite(a)
|
||||
|
||||
return ones_like(a, dtype=torch.bool)
|
||||
|
||||
|
Reference in New Issue
Block a user