Skip to content

Commit 6e85952

Browse files
committed
Simplify code block
1 parent 1ffb148 commit 6e85952

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tf2onnx/onnx_opset/tensor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,10 +846,8 @@ def version_10(cls, ctx, node, **kwargs):
846846
new_begin_mask = np.array(new_begin_mask, dtype=np_dtype)
847847
if not np.all(new_begin_mask == 1):
848848
if begin.is_const() and strides.is_const():
849-
begin_vals = begin.get_tensor_value(as_list=False)
850-
strides_vals = strides.get_tensor_value(as_list=False)
851-
new_begin_vals = np.copy(begin_vals)
852-
for i, v in enumerate(strides_vals):
849+
new_begin_vals = np.copy(begin.get_tensor_value(as_list=False))
850+
for i, v in enumerate(strides.get_tensor_value(as_list=False)):
853851
if v < 0 and new_begin_mask[i] == 0:
854852
new_begin_vals[i] = max_size
855853
begin = ctx.make_const(utils.make_name("begin_masked"), new_begin_vals)

0 commit comments

Comments
 (0)