-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
Make InputLayer support masking #10794
Conversation
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 PR.
tests/keras/layers/core_test.py
Outdated
@@ -4,7 +4,7 @@ | |||
|
|||
from keras import backend as K | |||
from keras import layers | |||
from keras.models import Model | |||
from keras.models import Model, Sequential |
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.
One import per line
tests/keras/layers/core_test.py
Outdated
@keras_test | ||
def test_sequential_as_downstream_of_masking_layer(): | ||
|
||
input = layers.Input(shape=(3, 4)) |
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.
input
is a reserved Python keyword, use inputs
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.
LGTM, thanks
Summary
Sequential
addsInputLayer
automatically if users don't assign. WhenSequential
was placed as downstream ofMasking
layer(#10763), even if all users explicitly added layers inSequential
support masking, it still throws exception due toInputLayer
doesn't support masking.I think
InputLayer
should support masking and it can use the defaultcompute_mask
function in base layer(just carry over the input mask). Because users don't add this layer explicitly, it should transparent to users.Related Issues
#10763
PR Overview