File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 4
4
# This source code is licensed under the BSD-style license found in the
5
5
# LICENSE file in the root directory of this source tree.
6
6
7
+ # pyre-strict
8
+
7
9
import copy
8
10
from typing import Dict , Union
9
11
@@ -61,4 +63,5 @@ def update_to_real_program(
61
63
"""Update the fake exported program to point to the real state dict. Modifies the
62
64
fake exported program in-place.
63
65
"""
64
- fake_exported_program ._state_dict = real_exported_program .state_dict
66
+ for k , v in real_exported_program .state_dict .items ():
67
+ fake_exported_program ._state_dict [k ] = v
Original file line number Diff line number Diff line change 4
4
# This source code is licensed under the BSD-style license found in the
5
5
# LICENSE file in the root directory of this source tree.
6
6
7
+ # pyre-strict
7
8
8
9
import sys
9
10
import unittest
@@ -73,4 +74,6 @@ def test_fake_program(self) -> None:
73
74
74
75
update_to_real_program (fake_program , exported_program )
75
76
self .assertEqual (exported_program .state_dict , fake_program .state_dict )
76
- self .assertEqual (id (exported_program .state_dict ), id (fake_program .state_dict ))
77
+ self .assertEqual (
78
+ exported_program .state_dict .keys (), fake_program .state_dict .keys ()
79
+ )
You can’t perform that action at this time.
0 commit comments