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

Relax input dtypes #966

Closed
dsmilkov opened this issue Dec 6, 2018 · 1 comment
Closed

Relax input dtypes #966

dsmilkov opened this issue Dec 6, 2018 · 1 comment
Assignees
Labels

Comments

@dsmilkov
Copy link
Contributor

dsmilkov commented Dec 6, 2018

To improve UX and make the code less error-prone, allow users to provide different dtypes in binary arithmetic ops (add/sub/mul/div/...) and matmul, just like in numpy.

The dtype of the result is upcasted i.e. matMul(float32, int32) => int32

@dsmilkov dsmilkov self-assigned this Dec 6, 2018
dsmilkov added a commit to tensorflow/tfjs-core that referenced this issue Dec 6, 2018
Allow users to provide different dtypes in binary arithmetic ops (add/sub/mul/div/...) and matmul, just like in numpy.

The dtype of the result is upcasted i.e. matMul(float32, int32) => float32

This will result in release patch 0.14.1, which will fix the breakage in 0.14.0 caused by #1408 due to improved dtype inference where tensor(new Int32Array()) is inferred to be int32, and was float32.

Fixes tensorflow/tfjs#934, tensorflow/tfjs#966
@rthadur
Copy link
Contributor

rthadur commented Apr 22, 2020

It looks like the related PR got merged so closing this issue.

@rthadur rthadur closed this as completed Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants