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

[tfjs-layers] fix reshape layer output shape computation #2719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pvanhaes
Copy link
Contributor

@pvanhaes pvanhaes commented Jan 31, 2020

Ensure that output shape is computed correctly when input shape has an unknown batch size.

In Keras, a Reshape layer with batch_input_shape=[None, 16] and target_shape=[-1, 1] has output shape [None, 16, 1] as the reshape operation is being applied per batch.
In TFJS an equivalent Reshape layer would have an output shape [None, None, 1] thus adding an unnecessary unknown dimension. Plus this behavior was not consistent with the python implementation.


This change is Reviewable

Ensure that output shape is computed correctly when input shape has an unknown batch size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants