-
Notifications
You must be signed in to change notification settings - Fork 533
Revert PR#3450 and use sparse_gather in gather #3566
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,10 +71,9 @@ void CheckSubOperandTypes(at::ScalarType type1, at::ScalarType type2) { | |
|
||
c10::optional<at::ScalarType> PromoteIntegralType( | ||
at::ScalarType src_dtype, const c10::optional<at::ScalarType>& opt_dtype) { | ||
return opt_dtype.has_value() | ||
? opt_dtype.value() | ||
: at::isIntegralType(src_dtype, /*includeBool=*/true) ? at::kLong | ||
: opt_dtype; | ||
return opt_dtype.has_value() ? opt_dtype.value() | ||
: at::isIntegralType(src_dtype, /*includeBool=*/true) ? at::kLong | ||
: opt_dtype; | ||
} | ||
|
||
bool IsTypeWithLargerRangeThanLong(torch::ScalarType dtype) { | ||
|
@@ -1495,10 +1494,11 @@ at::Tensor XLANativeFunctions::frac(const at::Tensor& self) { | |
|
||
at::Tensor XLANativeFunctions::gather(const at::Tensor& self, int64_t dim, | ||
const at::Tensor& index, | ||
bool /* sparse_grad */) { | ||
bool sparse_grad) { | ||
XLA_FN_COUNTER("xla::"); | ||
return bridge::AtenFromXlaTensor(XLATensor::gather( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto --> re-ran clang-format-7, nothing changed. Will leave it for now. |
||
bridge::GetXlaTensor(self), dim, bridge::GetXlaTensor(index))); | ||
return bridge::AtenFromXlaTensor( | ||
XLATensor::gather(bridge::GetXlaTensor(self), dim, | ||
bridge::GetXlaTensor(index), sparse_grad)); | ||
} | ||
|
||
at::Tensor XLANativeFunctions::ge(const at::Tensor& self, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1403,7 +1403,7 @@ XLATensor XLATensor::full_like(const XLATensor& input, | |
} | ||
|
||
XLATensor XLATensor::gather(const XLATensor& input, int64_t dim, | ||
const XLATensor& index) { | ||
const XLATensor& index, bool sparse_grad) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you need to pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's being passed already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it's not picked in this diff?! My local branch is up to date and shows the correct one -- but the github file view doesn't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, VS CODE didn't write out the change to the file, resyncing and recommiting. Thanks @miladm |
||
xla::Shape input_shape = input.shape(); | ||
xla::Shape index_shape = index.shape(); | ||
XLA_CHECK_EQ(input_shape.rank(), index_shape.rank()); | ||
|
Uh oh!
There was an error while loading. Please reload this page.