Skip to content

Commit 967e685

Browse files
committed
fix some dynamic tf.tandom_uniform cases
1 parent d43e6a1 commit 967e685

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tf2onnx/rewriter/random_uniform.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def create_onnx_random_uniform_op(g, tmax, tmin, ru_op, output, to_delete):
8686
# In many cases there is a shape op in tensorflow before RandomUniform and
8787
# to make that work for onnx we just need to remove the shape op.
8888
new_node = g.make_node("RandomUniformLike", inputs=[shape_node.input[0]], name=op_name,
89-
attr={"low": tmin, "high": tmax, "dtype": dtype},
90-
shapes=shape, dtypes=[dtype])
89+
attr={"low": tmin, "high": tmax, "dtype": dtype},
90+
shapes=shape, dtypes=[dtype])
9191
else:
9292
# if the shape is calculated we need to create a tensor so RandomUniformLike
9393
# can take the shape from there. Pre opset9 this is somewhat hacky because there is
@@ -104,6 +104,6 @@ def create_onnx_random_uniform_op(g, tmax, tmin, ru_op, output, to_delete):
104104
func(g, fill_node)
105105
# and use RandomUniformLike to create the random tensor
106106
new_node = g.make_node("RandomUniformLike", inputs=[fill_node.output[0]], name=op_name,
107-
attr={"low": tmin, "high": tmax, "dtype": dtype},
108-
shapes=shape, dtypes=[dtype])
107+
attr={"low": tmin, "high": tmax, "dtype": dtype},
108+
shapes=shape, dtypes=[dtype])
109109
return new_node

0 commit comments

Comments
 (0)