File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
tensorflow_model_optimization/python/core/internal/tensor_encoding/utils Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 20
20
from __future__ import division
21
21
from __future__ import print_function
22
22
23
+ import collections
23
24
import enum
24
25
import numpy as np
25
26
import six
@@ -99,7 +100,7 @@ def split_dict_py_tf(dictionary):
99
100
"""
100
101
if not isinstance (dictionary , dict ):
101
102
raise TypeError
102
- d_py , d_tf = {}, {}
103
+ d_py , d_tf = collections . OrderedDict (), collections . OrderedDict ()
103
104
for k , v in six .iteritems (dictionary ):
104
105
if isinstance (v , dict ):
105
106
d_py [k ], d_tf [k ] = split_dict_py_tf (v )
@@ -134,7 +135,7 @@ def merge_dicts(dict1, dict2):
134
135
ValueError:
135
136
If the input dictionaries do not have corresponding structure.
136
137
"""
137
- merged_dict = {}
138
+ merged_dict = collections . OrderedDict ()
138
139
if not (isinstance (dict1 , dict ) and isinstance (dict2 , dict )):
139
140
raise TypeError
140
141
You can’t perform that action at this time.
0 commit comments