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

Optimize backwards of narrow #255

Open
ezyang opened this issue Oct 28, 2017 · 0 comments
Open

Optimize backwards of narrow #255

ezyang opened this issue Oct 28, 2017 · 0 comments

Comments

@ezyang
Copy link
Owner

ezyang commented Oct 28, 2017

Narrow is a very cheap operation in forwards, because it doesn't have to do much, but it is expensive in backwards, since you must allocate a full size tensor and zero pad it out. This is a good opportunity for the optimizer.

Discovered this in the conversation at pytorch/pytorch#3313 (comment)

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

No branches or pull requests

1 participant