Skip to content

Commit 0cd7e14

Browse files
committed
abide by all linting rules
1 parent 84c5bc5 commit 0cd7e14

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/onnx_ir/passes/common/onnx_float_16.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,12 @@ def convert_float_to_float16(
287287
if attr.name == "to" and attr.i == 1:
288288
attr.i = 10
289289
break
290-
for attr in n.attribute:
291-
next_level.append(attr)
290+
next_level.extend(list(n.attribute))
292291
# if q is model.graph.node.attribute, push q.g and q.graphs (GraphProto)
293292
# and process node.attribute.t and node.attribute.tensors (TensorProto)
294293
if isinstance(q, onnx_proto.AttributeProto):
295294
next_level.append(q.g)
296-
for n in q.graphs:
297-
next_level.append(n)
295+
next_level.extend(list(q.graphs))
298296
q.t.CopyFrom(
299297
convert_tensor_float_to_float16(q.t, min_positive_val, max_finite_val)
300298
)

0 commit comments

Comments
 (0)