Skip to content

Commit

Permalink
Remove useless attr in Gelu/GeluBackward.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zantares committed Jan 15, 2025
1 parent 836aa97 commit cb891b4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions torch_xla/csrc/ops/ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ torch::lazy::NodePtr Gelu(const torch::lazy::Value& input) {

// Building composite computation.
const std::string name = std::string(GetCompositeNamespace()) + "gelu";
const std::string attr = "{approximate = \"none\"}";
xla::XlaBuilder builder(name);
xla::XlaOp arg = xla::Parameter(
&builder, 0, ShapeHelper::ShapeOfXlaOp(xla_input), "arg");
Expand All @@ -705,7 +704,7 @@ torch::lazy::NodePtr Gelu(const torch::lazy::Value& input) {
// Building call to computation.
std::vector<xla::XlaOp> inputs{xla_input};
xla::XlaOp output =
xla::CompositeCall(loctx->builder(), computation, inputs, name, attr);
xla::CompositeCall(loctx->builder(), computation, inputs, name);

return node.ReturnOp(output, loctx);
};
Expand All @@ -723,7 +722,6 @@ torch::lazy::NodePtr GeluBackward(const torch::lazy::Value& grad_output,
// Building composite computation.
const std::string name =
std::string(GetCompositeNamespace()) + "gelu_backward";
const std::string attr = "{approximate = \"none\"}";
xla::XlaBuilder builder(name);
xla::XlaOp arg_grad_output =
xla::Parameter(&builder, 0, ShapeHelper::ShapeOfXlaOp(xla_grad_output),
Expand All @@ -736,7 +734,7 @@ torch::lazy::NodePtr GeluBackward(const torch::lazy::Value& grad_output,
// Building call to computation.
std::vector<xla::XlaOp> inputs{xla_grad_output, xla_input};
xla::XlaOp output =
xla::CompositeCall(loctx->builder(), computation, inputs, name, attr);
xla::CompositeCall(loctx->builder(), computation, inputs, name);

return node.ReturnOp(output, loctx);
};
Expand Down

0 comments on commit cb891b4

Please sign in to comment.