Skip to content

Commit 97fcfe3

Browse files
authored
Replace is by == (#2326)
1 parent 3b5601e commit 97fcfe3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

onnx/helper.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,25 +275,25 @@ def make_attribute(
275275

276276

277277
def get_attribute_value(attr): # type: (AttributeProto) -> Any
278-
if attr.type is AttributeProto.FLOAT:
278+
if attr.type == AttributeProto.FLOAT:
279279
return attr.f
280-
elif attr.type is AttributeProto.INT:
280+
elif attr.type == AttributeProto.INT:
281281
return attr.i
282-
elif attr.type is AttributeProto.STRING:
282+
elif attr.type == AttributeProto.STRING:
283283
return attr.s
284-
elif attr.type is AttributeProto.TENSOR:
284+
elif attr.type == AttributeProto.TENSOR:
285285
return attr.t
286-
elif attr.type is AttributeProto.GRAPH:
286+
elif attr.type == AttributeProto.GRAPH:
287287
return attr.g
288-
elif attr.type is AttributeProto.FLOATS:
288+
elif attr.type == AttributeProto.FLOATS:
289289
return list(attr.floats)
290-
elif attr.type is AttributeProto.INTS:
290+
elif attr.type == AttributeProto.INTS:
291291
return list(attr.ints)
292-
elif attr.type is AttributeProto.STRINGS:
292+
elif attr.type == AttributeProto.STRINGS:
293293
return list(attr.strings)
294-
elif attr.type is AttributeProto.TENSORS:
294+
elif attr.type == AttributeProto.TENSORS:
295295
return list(attr.tensors)
296-
elif attr.type is AttributeProto.GRAPHS:
296+
elif attr.type == AttributeProto.GRAPHS:
297297
return list(attr.graphs)
298298
else:
299299
raise ValueError("Unsupported ONNX attribute: {}".format(attr))

0 commit comments

Comments
 (0)