-
Notifications
You must be signed in to change notification settings - Fork 45.8k
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
Made api's compatible with python3.7+ #11259
base: master
Are you sure you want to change the base?
Conversation
Hi @yeqingli, @lehougoogle, @Chen-Zhe, could you please review the PR. Thank You |
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.
Thanks for the fix. Please updates the something | None
to Optional[something]
.
@@ -33,7 +34,7 @@ class BaseTwoTowerUpliftNetwork(tf_keras.layers.Layer, metaclass=abc.ABCMeta): | |||
def call( | |||
self, | |||
inputs: types.DictOfTensors, | |||
training: bool | None = None, | |||
mask: tf.Tensor | None = None, | |||
training: Union[bool, None] = None, |
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.
I think Union[something | None]
is equivalent to Optional[something]
. Could you update here and all the other places if applicable.
@@ -263,8 +263,8 @@ def build_retinanet( | |||
l2_regularizer: Optional[tf_keras.regularizers.Regularizer] = None, | |||
backbone: Optional[tf_keras.Model] = None, | |||
decoder: Optional[tf_keras.Model] = None, | |||
num_anchors_per_location: int | dict[str, int] | None = None, | |||
anchor_boxes: Mapping[str, tf.Tensor] | None = None, | |||
num_anchors_per_location: Union[int, Dict[str, int], None] = None, |
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.
Can this Union[int, Dict[str, int], None]
be Optional[Union[int, Dict[str, int]]]
Description
Reference github issue #11247 #11256
Type of change
For a new feature or function, please create an issue first to discuss it
with us before submitting a pull request.
Note: Please delete options that are not relevant.
Tests
Test Configuration:
Checklist