Skip to content

Commit c9ac540

Browse files
committed
format unittest
Signed-off-by: Dom Miketa <[email protected]>
1 parent c859a1a commit c9ac540

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/backend/test_dynamic_shape.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,18 +249,23 @@ def test_conv_transpose(self):
249249
np.testing.assert_almost_equal(tf_model_output[0], test_output, decimal=5)
250250

251251
def test_depth_to_space(self):
252-
b,c,h,w = shape = [2, 48, 5, 6]
252+
b, c, h, w = shape = [2, 48, 5, 6]
253253
blocksize = 4
254254
x = self._get_rnd_float32(shape=shape)
255-
node_def = helper.make_node("DepthToSpace", ["X"], ["Y"], blocksize=blocksize, mode="DCR")
255+
node_def = helper.make_node("DepthToSpace", ["X"], ["Y"],
256+
blocksize=blocksize,
257+
mode="DCR")
256258
graph_def = helper.make_graph(
257259
[node_def],
258260
name="test_unknown_shape",
259261
inputs=[
260262
helper.make_tensor_value_info("X", TensorProto.FLOAT,
261263
[None, None, None, None])
262264
],
263-
outputs=[helper.make_tensor_value_info("Y", TensorProto.FLOAT, [None, None, None, None])])
265+
outputs=[
266+
helper.make_tensor_value_info("Y", TensorProto.FLOAT,
267+
[None, None, None, None])
268+
])
264269
tf_rep = onnx_graph_to_tensorflow_rep(graph_def)
265270
# export to tf.saved_model
266271
model_path = 'test_dynamic_shape/depth_to_space'
@@ -270,8 +275,8 @@ def test_depth_to_space(self):
270275
# run the model
271276
tf_model_output = tf_model(X=x)
272277
tmp = np.reshape(x, [b, blocksize, blocksize, c // (blocksize**2), h, w])
273-
tmp = np.transpose(tmp, [0, 3, 4, 1, 5 ,2])
274-
y = np.reshape(tmp, [b, c // (blocksize**2), h*blocksize, w*blocksize])
278+
tmp = np.transpose(tmp, [0, 3, 4, 1, 5, 2])
279+
y = np.reshape(tmp, [b, c // (blocksize**2), h * blocksize, w * blocksize])
275280
np.testing.assert_almost_equal(tf_model_output[0], y)
276281

277282
def test_eye_like(self):

0 commit comments

Comments
 (0)