Skip to content

Conversation

@yf225
Copy link
Contributor

@yf225 yf225 commented Sep 30, 2019

This PR adds temporary declarations for torch::k{name} enums, so that we can submit a PR to rename the enum usage in torchvision. And then, after the changes to torchvision is done, we can remove the temporary declarations in #26837 to officially move over to using c10::variant for enums.

@pytorchbot pytorchbot added the module: cpp Related to C++ API label Sep 30, 2019
@yf225
Copy link
Contributor Author

yf225 commented Sep 30, 2019

@ShahriarSS Would you like to review this PR? Thanks!

@yf225 yf225 force-pushed the bc_for_torchvision_nonlinearity_fanmode branch 3 times, most recently from f01ee19 to 9fbbcb9 Compare September 30, 2019 07:19
@yf225 yf225 force-pushed the bc_for_torchvision_nonlinearity_fanmode branch from 9fbbcb9 to ccdc2c8 Compare September 30, 2019 07:19
@yf225 yf225 requested a review from pbelevich September 30, 2019 17:11
@ShahriarRezghi
Copy link

@yf225 The code looks good but what are we trying to achieve here? Why do we need this PR?

@yf225
Copy link
Contributor Author

yf225 commented Sep 30, 2019

@ShahriarSS Thanks for reviewing - the goal is that after this PR is merged, we can change all torch::nn::init::Nonlinearity::{name} and torch::nn::init::FanMode::{name} usage in torchvision to just be torch::k{name}, so that the CI on #26837 would be green and we can then merge that PR.

@yf225 yf225 requested a review from ezyang September 30, 2019 19:36
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

OK. Are you sure these constants will never conflict with other constants we may want to expose in torch? I guess the risk is low.

@yf225
Copy link
Contributor Author

yf225 commented Sep 30, 2019

@ezyang Yes I think the risk of constants conflict should be low for the torch:: namespace, and we should be able to find workarounds if it really happens.

Copy link
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.

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

@facebook-github-bot
Copy link
Contributor

@yf225 merged this pull request in 27d4b34.

pdlive215 pushed a commit to pdlive215/pytorch that referenced this pull request Nov 27, 2019
Summary:
This PR adds temporary declarations for `torch::k{name}` enums, so that we can submit a PR to rename the enum usage in torchvision. And then, after the changes to torchvision is done, we can remove the temporary declarations in pytorch#26837 to officially move over to using `c10::variant` for enums.
Pull Request resolved: pytorch#27051

Differential Revision: D17672220

Pulled By: yf225

fbshipit-source-id: 4ae77634e8c7efa3404698f7c1a69177cbb5dab3
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
Summary:
This PR adds temporary declarations for `torch::k{name}` enums, so that we can submit a PR to rename the enum usage in torchvision. And then, after the changes to torchvision is done, we can remove the temporary declarations in pytorch#26837 to officially move over to using `c10::variant` for enums.
Pull Request resolved: pytorch#27051

Differential Revision: D17672220

Pulled By: yf225

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

Labels

Merged module: cpp Related to C++ API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants