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

RFC: Making dtype promotion semantics in Tensorflow more consistent #431

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 20221018-promotion-semantics.md
JW1992 authored Oct 19, 2022
commit 951647cf1814f7f5a04dc18de5ffb15c2e82d4aa
4 changes: 2 additions & 2 deletions rfcs/20221018-promotion-semantics.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
| Status | (Proposed) |
:-------------- |:---------------------------------------------------- |
| **RFC #** | [NNN](https://github.com/tensorflow/community/pull/NNN) (update when you have community PR #)|
| **Author(s)** | Jiawei Xia ([email protected]) |
| **Author(s)** | Jiawei Xia ([email protected]), Antonio Sanchez ([email protected] ) |
| **Sponsor** | Peng Wang ([email protected]) |
| **Updated** | 2022-10-18 |

@@ -108,7 +108,7 @@ In this mode, we allow all implicit promotions to happen in the op, even if both
* If the python scalar value falls within the range of the TF dtype, the result dtype is loosely described with the following promotion direction: TF bool -> python integer -> TF signed/unsigned integers -> python float -> TF float -> python complex/TF complex.
* The dtype promotion is allowed only if the python scalar is within the range of the determined dtype. Otherwise, an exception is raised. For example, `tf.constant([1], tf.int8) + 1` produces a `tf.int8` Tensor, while `tf.constant([1], tf.int8) + 1000` raises an error.

This mode is intended to provide a user experience similar to NumPy behaviors.
This mode is intended to provide a user experience somewhat similar to NumPy behaviors.


### **Mode 2: tf.ImplicitPromotion.SAFE**