Skip to content

fix: Remove references to _native_batch_norm_legit_no_training for PyTorch 2.0 Stable #1837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions py/torch_tensorrt/fx/passes/lower_basic_pass_aten.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def replace_aten_op_with_indices(module: torch.fx.GraphModule) -> torch.fx.Graph
torch.ops.aten.max_pool3d_with_indices.default,
torch.ops.aten.native_batch_norm.default,
torch.ops.aten._native_batch_norm_legit.default,
torch.ops.aten._native_batch_norm_legit_no_training.default,
):
modified = True
if len(n.users) != 1:
Expand All @@ -186,16 +185,6 @@ def replace_aten_op_with_indices(module: torch.fx.GraphModule) -> torch.fx.Graph
new_args = list(n.args)
new_args.append(False)
new_args = tuple(new_args)
elif (
n.target == torch.ops.aten._native_batch_norm_legit_no_training.default
):
new_op = torch.ops.aten.batch_norm
new_args = list(n.args)
new_args.append(False)
# _native_batch_norm_legit_no_training doesn't take in a training arg (assumed to be false)
# but batchnorm takes in a training arg at position 5.
new_args.insert(5, False)
new_args = tuple(new_args)

getitem_node = next(iter(n.users))
with module.graph.inserting_after(getitem_node):
Expand Down