Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Handle multiple dimension case for BatchNormalization #106

Merged
merged 5 commits into from
Jun 6, 2019

Conversation

jiafatom
Copy link
Collaborator

@jiafatom jiafatom commented Jun 6, 2019

No description provided.

@jiafatom jiafatom requested a review from vinitra-zz June 6, 2019 20:52
@@ -62,4 +69,4 @@ def convert_keras_batch_normalization(scope, operator, container):
momentum=momentum, spatial=spatial)

# Permute [N,C,H,W] to [N,H,W,C]

Choose a reason for hiding this comment

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

Clarify that this comment is for the 4D input shape case

Copy link

@vinitra-zz vinitra-zz left a comment

Choose a reason for hiding this comment

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

LGTM, suggested a small descriptive change but it's not strictly necessary

perm_1 = list(range(1, len(op.input_shape) - 1))
perm_1 = [0, len(op.input_shape) - 1] + perm_1
perm_2 = list(range(2, len(op.input_shape)))
perm_2 = [0] + perm_2 + [1]

Choose a reason for hiding this comment

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

Also, might not ever need to calculate perm_1 and perm_2 if skip_transpose is False. Perhaps move these into the respective sections for converter efficiency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, will do

@jiafatom jiafatom merged commit 45542a9 into onnx:master Jun 6, 2019
wenbingl pushed a commit that referenced this pull request Oct 22, 2019
lock tf to 1.9 ... travis build having issues with 1.10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants