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

map bfloat to float16 #878

Merged
merged 3 commits into from Apr 10, 2020
Merged

Conversation

RandySheriffH
Copy link
Collaborator

@RandySheriffH RandySheriffH commented Apr 9, 2020

Map bfloat to float16 to address #735.

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})

Copy link
Contributor

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?

@guschmue
Copy link
Collaborator

guschmue commented Apr 9, 2020

Don't think we had a real model. But somebody was asking for it.

@RandySheriffH RandySheriffH changed the title map bfloat to float32 map bfloat to float16 Apr 9, 2020
@@ -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,
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants