mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
[dynamo] Fix source for default dict default_factory (#120864)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/120864 Approved by: https://github.com/yanboliang, https://github.com/Skylion007, https://github.com/jansel
This commit is contained in:
parent
df1e855313
commit
66d05a8900
|
|
@ -468,10 +468,13 @@ class VariableBuilder:
|
|||
)
|
||||
|
||||
if istype(value, collections.defaultdict):
|
||||
factory_source = AttrSource(self.source, "default_factory")
|
||||
result = DefaultDictVariable(
|
||||
result,
|
||||
type(value),
|
||||
default_factory=self._wrap(value.default_factory),
|
||||
default_factory=VariableBuilder(self.tx, factory_source)(
|
||||
value.default_factory
|
||||
),
|
||||
source=self.source,
|
||||
)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user