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

Fix maxPool save. #3337

Merged
merged 2 commits into from
May 28, 2020
Merged

Fix maxPool save. #3337

merged 2 commits into from
May 28, 2020

Conversation

lina128
Copy link
Collaborator

@lina128 lina128 commented May 27, 2020

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

Copy link
Contributor

@tafsiri tafsiri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Without this the 'shortcut' wasn't saving any compute.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @lina128)


tfjs-core/src/ops/max_pool.ts, line 92 at r1 (raw file):

    if (convInfo.filterWidth === 1 && convInfo.filterHeight === 1 &&
        util.arraysEqual(convInfo.inShape, convInfo.outShape)) {
      const y = x4D.clone();

Let's just have the assignment to y inside an if else block and have the common save and return outside it (that way it is not repeated).

@lina128 lina128 merged commit 9c9d830 into tensorflow:master May 28, 2020
@lina128 lina128 deleted the temp2 branch May 28, 2020 21:59
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.

None yet

3 participants