sony / nnabla

Neural Network Libraries
https://nnabla.org/
Apache License 2.0
2.73k stars 334 forks source link

opset 14 importer support #1232

Closed TomonobuTsujikawa closed 1 year ago

TomonobuTsujikawa commented 1 year ago

This PR tends to introduce support for onnx opset14 importer,

This change includes the addition of two new operations:

and modifications made to existing operations:

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.