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

opset 14 importer support #1232

Merged
merged 5 commits into from Nov 13, 2023
Merged

Conversation

TomonobuTsujikawa
Copy link
Contributor

@TomonobuTsujikawa TomonobuTsujikawa commented Nov 10, 2023

This PR tends to introduce support for onnx opset14 importer,

This change includes the addition of two new operations:

  • HardSwish
  • Trilu

and modifications made to existing operations:

  • BatchNormalization: add training_mode attribute and adjust output
  • Reshape: add allowzero attribute

The limitation:

BatchNormalization

In ONNX opset 14, When attribute training_mode is set 1, the outputs are updated as follows:

running_mean = input_mean * momentum + current_mean * (1 - momentum)
running_var = input_var * momentum + current_var * (1 - momentum)

Y = (X - current_mean) / sqrt(current_var + epsilon) * scale + B

In nnabla, the outputs always return the batch statistics of mean and variance.
And, running mean and running variance will be modified inplace as inputs during the forward execution

Reshape

In ONNX opset 14, When attribute allowzero is set 1, dimensions in new_shape with a value of 0 will be set to 0.
nnabla don't support variable_instance with dimensions containing zeros.

@TomonobuTsujikawa TomonobuTsujikawa force-pushed the feature/20230925-add-opset-14-importer branch from 7df086e to 3244d12 Compare November 10, 2023 11:17
@YukioOobuchi YukioOobuchi merged commit 868e670 into master Nov 13, 2023
@YukioOobuchi YukioOobuchi deleted the feature/20230925-add-opset-14-importer branch November 13, 2023 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-format-converter Auto-release; Format Converter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants