-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance BatchToSpaceND to support 3D input data #598
Conversation
tf2onnx/onnx_opset/tensor.py
Outdated
GraphBuilder(ctx).make_slice(kwargs, name=node.name, dtypes=dtypes, shapes=shapes) | ||
shapes = ctx.get_shape(node.output[0]) | ||
|
||
if len(ctx.get_shape(input_tensor.output[0])) == 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a variable denoting ctx.get_shape(input_tensor.output[0]))
?
tf2onnx/onnx_opset/tensor.py
Outdated
shapes = [ctx.get_shape(node.output[0])] | ||
ctx.remove_node(node.name) | ||
GraphBuilder(ctx).make_slice(kwargs, name=node.name, dtypes=dtypes, shapes=shapes) | ||
shapes = ctx.get_shape(node.output[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node.output_shapes and node.output_dtypes?
tf2onnx/onnx_opset/tensor.py
Outdated
kwargs = {**inputs_map} | ||
ctx.remove_node(node.name) | ||
slice1 = GraphBuilder(ctx).make_slice(kwargs) | ||
ctx.make_node("Squeeze", [slice1], {"axes": [3]}, outputs=node.output, name=node.name, dtypes=dtypes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also set shapes
tf2onnx/onnx_opset/tensor.py
Outdated
else: | ||
kwargs = {**inputs_map, "outputs": node.output} | ||
ctx.remove_node(node.name) | ||
GraphBuilder(ctx).make_slice(kwargs, name=node.name, dtypes=dtypes, shapes=[shapes]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep consistent: shapes=shapes
I tried to make the changes clear.
issue #572