Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Two amendments for the shape analysis#18271

Closed
t-vi wants to merge 2 commits into
pytorch:masterfrom
t-vi:shape_analyis_batch_norm_stats
Closed

Two amendments for the shape analysis#18271
t-vi wants to merge 2 commits into
pytorch:masterfrom
t-vi:shape_analyis_batch_norm_stats

Conversation

@t-vi
Copy link
Copy Markdown
Collaborator

@t-vi t-vi commented Mar 21, 2019

Two small refinements to the shape analysis:

  • detach can set requires grad to false for dimensioned tensors (not sure if I would also need to deal with Complete?).
  • add batch_norm_stats.

I noticed these while looking at what's going on when trying to code batch norm manually. (Hi @wanchaol )

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 21, 2019
Copy link
Copy Markdown
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

LGTM

if (type->scalarType() == at::kHalf) {
type = type->toScalarType(at::kFloat);
}
type = type->withDim(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: the indentation is messed up here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👍 Thanks for catching.

@t-vi
Copy link
Copy Markdown
Collaborator Author

t-vi commented Mar 21, 2019

@pytorchbot merge this please

@pytorchbot pytorchbot added the merge-this-please Was marked for merge with @pytorchbot merge this please label Mar 21, 2019
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Two small refinements to the shape analysis:
- `detach` can set requires grad to false for dimensioned tensors (not sure if I would also need to deal with Complete?).
- add `batch_norm_stats`.

I noticed these while looking at what's going on when trying to code batch norm manually. (Hi wanchaol )
Pull Request resolved: pytorch#18271

Differential Revision: D14561303

Pulled By: ezyang

fbshipit-source-id: 64a6879392e77403c44f2ed82f84b6397754d0ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-this-please Was marked for merge with @pytorchbot merge this please oncall: jit Add this issue/PR to JIT oncall triage queue open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants