File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,17 @@ def get_nodeattr(self, name):
9999 ret = ret .decode ("utf-8" )
100100 elif dtype == "strings" :
101101 ret = [x .decode ("utf-8" ) for x in ret ]
102- elif dtype == "t" :
103- # use numpy helper to convert TensorProto -> np array
104- ret = np_helper .to_array (ret )
102+ elif dtype == "floats" :
103+ # convert from RepeatedScalarContainer to list
104+ # gives e.g. JSON serializability
105+ ret = [x for x in ret ]
105106 elif dtype == "ints" :
106107 # convert from RepeatedScalarContainer to list
107108 # gives e.g. JSON serializability
108109 ret = [x for x in ret ]
110+ elif dtype == "t" :
111+ # use numpy helper to convert TensorProto -> np array
112+ ret = np_helper .to_array (ret )
109113 if allowed_values is not None :
110114 assert ret in allowed_values , "%s = %s not in %s" % (
111115 str (name ),
You can’t perform that action at this time.
0 commit comments