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
map bfloat to float16 #878
map bfloat to float16 #878
Conversation
s_ = tf.add(x_, y_) | ||
return tf.cast(s_, tf.float32, name=_TFOUTPUT) | ||
self._run_test_case(func, [_OUTPUT], {_INPUT: x_val, _INPUT1: y_val}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few questions below:
- is there a model that is unblocked by this?
- the test passes with small int values, but are there any values that will cause a failure?
Don't think we had a real model. But somebody was asking for it. |
tf2onnx/tf_utils.py
Outdated
@@ -32,6 +32,7 @@ | |||
TF_TO_ONNX_DTYPE = { | |||
types_pb2.DT_FLOAT: onnx_pb.TensorProto.FLOAT, | |||
types_pb2.DT_HALF: onnx_pb.TensorProto.FLOAT16, | |||
types_pb2.DT_BFLOAT16: onnx_pb.TensorProto.FLOAT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want that to be onnx_pb.TensorProto.FLOAT16 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Map bfloat to float16 to address #735.