-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Replace type().ScalarType() with scalar_type() #272
Conversation
Hi, I think we should tag the current master as a compatible version for the latest pytorch stable release. |
csrc/type_shim.h
Outdated
|
||
#define DISPATCH_FLOAT_AND_HALF(TYPE, LEVEL, NAME, ...) \ | ||
switch(TYPE) \ | ||
{ \ | ||
case at::ScalarType::Float: \ | ||
case at::kFloat: \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel more comfortable with the existing at::ScalarType::Float
syntax because that's what the upstream dispatch macros currently use https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/Dispatch.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it back to the at::ScalarType::Type
usage for most of the code. I only left the usage of at::kType
for creating new tensors (in case tensor.scalar_type()
wasn't used), as it seems to be the recommended way (link).
Would this be alright or should I revert all usages of at::kType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel most comfortable mirroring what upstream does, so this seems fine
Fixes #267
PyTorch PR pytorch/pytorch#17991 introduced some breaking changes which broke building
apex
using PyTorch master.This PR replaces all deprecated
.type().ScalarType()
calls with.scalar_type()
as well asat::ScalarType::Type
withat::kType
.