Skip to content
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

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

lei-Qiao
Copy link
Contributor

@lei-Qiao lei-Qiao commented Jun 14, 2019

I tried to make the changes clear.
issue #572

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:
Copy link
Collaborator

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]))?

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])
Copy link
Collaborator

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 Show resolved Hide resolved
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also set shapes

else:
kwargs = {**inputs_map, "outputs": node.output}
ctx.remove_node(node.name)
GraphBuilder(ctx).make_slice(kwargs, name=node.name, dtypes=dtypes, shapes=[shapes])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep consistent: shapes=shapes

@lucienwang1009 lucienwang1009 merged commit 64e4208 into onnx:master Jun 19, 2019
@lei-Qiao lei-Qiao deleted the batch_to_space_3d branch July 11, 2019 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants