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
Simplify shape inference in Keras resize_images #47011
Simplify shape inference in Keras resize_images #47011
Conversation
Please add a unit test! |
@mattdangerw the correct output shape computations should already be covered in the following test cases tensorflow/tensorflow/python/keras/backend_test.py Lines 599 to 615 in c4d6c69
But let me know if there is still a case I am missing. |
Look like we are missing a case for a partially defined shape to me. Something that exercises the else block in your change. |
@mattdangerw Sorry about that, I added a test case for dynamic input shapes. |
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! lgtm
This PR simplifies shape inference of
keras.backend.resize_images
, since the shape of the output tensor is already correctly set inimage_ops.resize_images_v2
:tensorflow/tensorflow/python/ops/image_ops_impl.py
Line 1390 in 0921a80
This also removes the need for the
tf.shape
op in cases where the spatial shape of the input tensor is fully defined which fixes #25086.