mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Enable all SIM rules except disabled ones (#164645)
`SIM` rules are useful for simplifying boolean expressions and enhances code readability. Pull Request resolved: https://github.com/pytorch/pytorch/pull/164645 Approved by: https://github.com/ezyang, https://github.com/mlazos
This commit is contained in:
committed by
PyTorch MergeBot
parent
f1d882212a
commit
e925dfcc6b
@ -150,7 +150,7 @@ def gen_vmap_inplace_plumbing(native_function: NativeFunction) -> str | None:
|
||||
assert schema.kind() == SchemaKind.inplace
|
||||
if not is_mutated_arg(schema.arguments.flat_all[0]):
|
||||
return None
|
||||
if not len([arg for arg in schema.arguments.flat_all if is_mutated_arg(arg)]) == 1:
|
||||
if len([arg for arg in schema.arguments.flat_all if is_mutated_arg(arg)]) != 1:
|
||||
return None
|
||||
|
||||
# Only support cases where all returns are Tensors or vector<Tensor>
|
||||
|
Reference in New Issue
Block a user