Skip to content

Commit

Permalink
Remove shape arg of GetIrValueForConstant
Browse files Browse the repository at this point in the history
  • Loading branch information
qihqi committed Dec 14, 2023
1 parent f5dface commit 199597a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion torch_xla/csrc/tensor_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ XLATensorPtr pow(const XLATensorPtr& input, const at::Scalar& exponent) {
// We want to pass exponent_node as a constant to give XLA more room to
// optimize
torch::lazy::Value exponent_node =
XLAGraphExecutor::Get()->GetIrValueForConstant(exponent, input->shape());
XLAGraphExecutor::Get()->GetIrValueForConstant(exponent);
torch::lazy::NodePtr node = Pow(input->GetIrValue(), exponent_node);
auto* xla_node = dynamic_cast<XlaNode*>(node.get());
at::ScalarType dtype =
Expand Down
2 changes: 1 addition & 1 deletion torch_xla/csrc/xla_graph_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ torch::lazy::Value XLAGraphExecutor::GetDeviceDataIrValue(
}

torch::lazy::Value XLAGraphExecutor::GetIrValueForConstant(
const at::Scalar& value, const xla::Shape& shape) {
const at::Scalar& value) {
torch::lazy::Value ir_value =
ScalarOp(std::move(value), XlaTypeFromTorchType(value.type()));
return ir_value;
Expand Down
3 changes: 1 addition & 2 deletions torch_xla/csrc/xla_graph_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class XLAGraphExecutor : public torch::lazy::LazyGraphExecutor {
const torch::lazy::BackendDevice& device);
// Use with caution, constant will cause more frequent recompilation
// compared to the device_data.
torch::lazy::Value GetIrValueForConstant(const at::Scalar& value,
const xla::Shape& shape);
torch::lazy::Value GetIrValueForConstant(const at::Scalar& value);
torch::lazy::Value GetIrValueForScalar(
const at::Scalar& value, xla::PrimitiveType type,
const torch::lazy::BackendDevice& device);
Expand Down

0 comments on commit 199597a

Please sign in to comment.