[dynamo] Return gm.forward for eager backend (#124109)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/124109
Approved by: https://github.com/yanboliang, https://github.com/jansel
ghstack dependencies: #124445
This commit is contained in:
Animesh Jain
2024-04-19 18:02:04 -07:00
committed by PyTorch MergeBot
parent febc4d8759
commit a32eac345f
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ This file contains TorchDynamo backends intended for debugging uses.
@register_backend
def eager(gm, fake_tensor_inputs):
return gm
return gm.forward
@register_backend

View File

@ -208,7 +208,7 @@ class EagerAndRecordGraphs:
def __call__(self, gm: torch.fx.GraphModule, example_inputs: List[torch.Tensor]):
self.graphs.append(gm)
return gm
return gm.forward
def strip_comment(code) -> str: