Skip to content

Added support for the gradient of the pad function. #226

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

Merged
merged 4 commits into from
Nov 27, 2018

Conversation

rikvdkleij
Copy link
Contributor

Please check if the implementation is right.

gradientSliceSize = shape (x :: Tensor Build Float)

opGrad "BatchToSpaceND" _ [_, toT -> blockShape, toT -> crops] [dz] =
[Just $ CoreOps.spaceToBatchND dz blockShape' crops', Nothing, Nothing]
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if you can simplify this is a bit, like

-- TODO: This could be either Int32 or Int64.
opGrad "BatchToSpaceND" _ [_, toT @Int32 -> blockShape, toT @Int32 -> crops] [dz] =
  [Just $ CoreOps.spaceToBatchND dz blockShape crops, Nothing, Nothing]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fkm3 Done.

@fkm3 fkm3 merged commit e4acd69 into tensorflow:master Nov 27, 2018
@fkm3
Copy link
Contributor

fkm3 commented Nov 27, 2018

Thanks for the contribution!

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.

3 participants