mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add missing docstring for sym_ite
(#154201)
`sym_ite` is listed in [the reference page](https://docs.pytorch.org/docs/stable/torch.html) and has no document. Pull Request resolved: https://github.com/pytorch/pytorch/pull/154201 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
02445ec8f0
commit
f55f2f42a7
@ -999,7 +999,6 @@ coverage_ignore_functions = [
|
|||||||
"to_node",
|
"to_node",
|
||||||
"wrap_node",
|
"wrap_node",
|
||||||
"sym_sqrt",
|
"sym_sqrt",
|
||||||
"sym_ite",
|
|
||||||
# torch.fx.experimental.symbolic_shapes
|
# torch.fx.experimental.symbolic_shapes
|
||||||
"bind_symbols",
|
"bind_symbols",
|
||||||
"cast_symbool_to_symint_guardless",
|
"cast_symbool_to_symint_guardless",
|
||||||
|
@ -978,6 +978,7 @@ __all__.append("sym_sqrt")
|
|||||||
|
|
||||||
|
|
||||||
def sym_ite(b, t, f):
|
def sym_ite(b, t, f):
|
||||||
|
"""SymInt-aware utility for ternary operator (``t if b else f``.)"""
|
||||||
if overrides.has_torch_function((b, t, f)):
|
if overrides.has_torch_function((b, t, f)):
|
||||||
return overrides.handle_torch_function(sym_ite, (b, t, f), b, t, f)
|
return overrides.handle_torch_function(sym_ite, (b, t, f), b, t, f)
|
||||||
assert isinstance(b, (SymBool, builtins.bool)) and type(t) == type(f)
|
assert isinstance(b, (SymBool, builtins.bool)) and type(t) == type(f)
|
||||||
|
Reference in New Issue
Block a user