Skip to content

Make c10::Scalar::to<T>() const#26406

Closed
yf225 wants to merge 1 commit intopytorch:masterfrom
yf225:fix_c10_scalar_to
Closed

Make c10::Scalar::to<T>() const#26406
yf225 wants to merge 1 commit intopytorch:masterfrom
yf225:fix_c10_scalar_to

Conversation

@yf225
Copy link
Contributor

@yf225 yf225 commented Sep 18, 2019

Since c10::Scalar::to<T>() is not an in-place operation, we should be able to make it const. This removes the need of using const_cast at #26210 (comment).

@yf225 yf225 requested a review from smessmer September 18, 2019 15:18
@pytorchbot pytorchbot added the module: internals Related to internal abstractions in c10 and ATen label Sep 18, 2019
@yf225 yf225 requested a review from zou3519 September 18, 2019 15:28
Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

Yup, they're all const

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 4f7848e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: internals Related to internal abstractions in c10 and ATen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants