Skip to content

Commit e8ca5a8

Browse files
committed
Reformat
1 parent d673d7c commit e8ca5a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tf2onnx/onnx_opset/tensor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,15 +1230,16 @@ def mkconst(desc, val, dtype=np.int64):
12301230

12311231
# support non 4D tensors and dynamic crop vals
12321232
# dynamic slice starts at opset 10
1233-
utils.make_sure(ctx.opset >= 10, 'not-4D tensor or non-const pads require opset 10+')
1233+
utils.make_sure(ctx.opset >= 10, 'non-4D tensor or non-const crops require opset 10+')
12341234

12351235
input0 = node.input[0]
12361236
input2 = node.input[2]
1237+
1238+
# const vals
12371239
int_max_const = mkconst('int_max', np.array([utils.get_max_value(np.int64)]))
12381240
one_const = mkconst('_const_one', np.array([1]))
12391241
minus1_const = mkconst('_const_minus1', np.array([-1]))
12401242
blocklen_resize_const = mkconst('_const_blocklen_resize', np.array([-1, blocklen]))
1241-
12421243
blocklenplus1_const = mkconst('_const_blocklenplus1', np.array([blocklen + 1]))
12431244
block_shape_const = mkconst('_const_block_shape', block_shape)
12441245

@@ -1357,17 +1358,17 @@ def mkconst(desc, val, dtype=np.int64):
13571358

13581359
# support non 4D tensors and dynamic pad vals
13591360
# dynamic slice starts at opset 10
1360-
utils.make_sure(ctx.opset >= 10, 'not-4D tensor or non-const pads require opset 10+')
1361+
utils.make_sure(ctx.opset >= 10, 'non-4D tensor or non-const pads require opset 10+')
13611362

13621363
input0 = node.input[0]
13631364
input2 = node.input[2]
1365+
13641366
# const vals
13651367
int_max_const = mkconst('int_max', np.array([utils.get_max_value(np.int64)]))
13661368
zero_const = mkconst('_zero_const', np.array([0]))
13671369
one_const = mkconst('_one_const', np.array([1]))
13681370
minus1_const = mkconst('_minus1_const', np.array([-1]))
13691371
blocklen_resize_const = mkconst('_blocklen_resize_const', np.array([-1, blocklen]))
1370-
13711372
blocklenplus1_const = mkconst('_blocklenplus1_const', np.array([blocklen + 1]))
13721373
filltop_const = mkconst('_filltop_const', np.array([1, 0, 0, 0]))
13731374
fillbottom_const = mkconst('_bottom_const', np.array([0, 0, 1, 0]))

0 commit comments

Comments
 (0)