mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-08 07:39:33 +01:00
[dynamo][nn module] Use correct sources for _call_impl (#124970)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/124970 Approved by: https://github.com/jansel ghstack dependencies: #124779, #124627
This commit is contained in:
parent
43069c460e
commit
fd24d8c05a
|
|
@ -340,9 +340,10 @@ class NNModuleVariable(VariableTracker):
|
||||||
# If so at least some changes are needed, we don't allow inlining
|
# If so at least some changes are needed, we don't allow inlining
|
||||||
# the call_wrapped currently, and maybe other issues too
|
# the call_wrapped currently, and maybe other issues too
|
||||||
fn = mod.forward
|
fn = mod.forward
|
||||||
|
fn_source = AttrSource(self.source, "forward")
|
||||||
else:
|
else:
|
||||||
fn = mod._call_impl
|
fn = mod._call_impl
|
||||||
fn_source = AttrSource(self.source, "__call__")
|
fn_source = AttrSource(self.source, "_call_impl")
|
||||||
if istype(fn, types.MethodType):
|
if istype(fn, types.MethodType):
|
||||||
fn = fn.__func__
|
fn = fn.__func__
|
||||||
fn_source = AttrSource(fn_source, "__func__")
|
fn_source = AttrSource(fn_source, "__func__")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user