There is a newer version of the record available.

Published September 25, 2022 | Version 1.1.32
Software Open

Tools to convert ONNX files (NCHW) to TensorFlow format (NHWC)

Authors/Creators

Description

  • Improved Erf calculation error
eps = 1e-11
x_abs = tf.math.abs(input_tensor)
sign = tf.math.divide(input_tensor, tf.math.abs(input_tensor)+eps)
a1 =  0.254829592
a2 = -0.284496736
a3 =  1.421413741
a4 = -1.453152027
a5 =  1.061405429
p  =  0.3275911
t = 1.0/(1.0 + p*x_abs)
y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*tf.math.exp(-x_abs*x_abs)
erf_tensor = sign*y
tf_layers_dict[graph_node_output.name]['tf_node'] = erf_tensor

Full Changelog: https://github.com/PINTO0309/onnx2tf/compare/1.1.31...1.1.32

Notes

If you use onnx2tf in your research, please cite it using these metadata.

Files

PINTO0309/onnx2tf-1.1.32.zip

Files (378.0 kB)

Name Size Download all
md5:1f93520dc8467b6f3bc22fd12e92fd9e
378.0 kB Preview Download

Additional details

Related works