Skip to content

Fix CPU resizeBilinear gradient shape for non-square inputs - #8758

Open
ChengCK18 wants to merge 1 commit into
tensorflow:masterfrom
ChengCK18:fix/resize-bilinear-grad
Open

ChengCK18 wants to merge 1 commit into
tensorflow:masterfrom
ChengCK18:fix/resize-bilinear-grad

Conversation

@ChengCK18

Copy link
Copy Markdown

Fixes #8757

The CPU ResizeBilinearGrad kernel returned its output shape as [batch, width, height, depth] instead of [batch, height, width, depth]. The values were computed in the correct layout, so only the shape was wrong, and autodiff threw for any non-square input. The WASM and WebGL kernels already use the input shape.

Added a gradient test with a non-square input. it fails on the CPU backend without this change and passes with it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CPU] ResizeBilinearGrad swaps height and width for rectangular inputs in TensorFlow.js 4.22.0

1 participant