Unexpected behavior calling tf.keras.Model.call() with named parameters #35902
Labels
comp:keras
Keras related issues
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
TF 2.0
Issues relating to TensorFlow 2.0
type:bug
Bug
Projects
System information
yes
Linux Ubuntu 18.04.3 LTS
binary
2.0.2
Python 3.7.4 Anaconda
ROCM
:The full environment script does not work for my machine, but:
Describe the current behavior
I am getting odd behavior when calling a
tf.keras.Model
'scall
method when using the names of the method's parameters. The method works as expected when using position only arguments, but breaks when using the names. However, when I call mymodel_instance.call()
with the names of the method parameters, things work as expected. It is making me wonder which__call__
method I am calling when simply runningmodel_instance()
.Describe the expected behavior
Using the names of the parameters in a
tf.keras.Model
'scall
method should not be raising an error.Code to reproduce the issue
First, a little bit of setup showing that calling a
tf.keras.layers.Attention
instance from a function works with and without using the names of the positional arguments in a user defined function,call
:Things start getting weird when doing something similar within a
tf.keras.Model
:Finally, if I explicitly call
my_attention.call()
:Other info / logs
Here is a gist to show this behavior:
https://gist.github.com/yngtodd/f3bda25503a9611765ab33c1178db48c
The text was updated successfully, but these errors were encountered: