Skip to content

Conversation

@ManfeiBai
Copy link
Collaborator

@ManfeiBai ManfeiBai commented Nov 10, 2022

Partially codegen atan2


Generated LazyIr.h:

class Atan2 : public XlaNode {
 public:
  static torch::lazy::OpKind ClassOpKind() {
    return torch::lazy::OpKind(at::aten::atan2);
  }

  Atan2(const torch::lazy::Value& self, const torch::lazy::Value& other)
      : XlaNode(torch::lazy::OpKind(at::aten::atan2),
              {self, other},
              [&]() { return Atan2OutputShape(self, other); },
              /* num_outputs */ 1,
              torch::lazy::MHash())
  {
    
  }

  std::string ToString() const override {
    std::stringstream ss;
    ss << XlaNode::ToString();
    
    return ss.str();
  }

  

  bool CanBeReused(const torch::lazy::Value& self, const torch::lazy::Value& other) const {
    return false;
    }

  torch_xla::XlaOpVector Lower(LoweringContext* loctx) const override;

  
  

};

@ManfeiBai ManfeiBai requested a review from wonjoo-wj November 10, 2022 01:05
@ManfeiBai ManfeiBai closed this Nov 10, 2022
@ManfeiBai ManfeiBai reopened this Nov 10, 2022
@ManfeiBai ManfeiBai marked this pull request as ready for review November 10, 2022 17:16
Copy link
Collaborator

@wonjoo-wj wonjoo-wj left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@wonjoo-wj
Copy link
Collaborator

Feel free to merge this.

@ManfeiBai ManfeiBai merged commit b549612 into pytorch:master Nov 10, 2022
@wonjoo-wj
Copy link
Collaborator

Just a note for the future, let's remove "[WIP]" in the PR title before we merge 😄

@ManfeiBai ManfeiBai changed the title [WIP] Partially Codegen Atan2 Partially Codegen Atan2 Nov 10, 2022
@ManfeiBai
Copy link
Collaborator Author

ManfeiBai commented Nov 10, 2022

Just a note for the future, let's remove "[WIP]" in the PR title before we merge 😄

yeah, sure, thanks, wonjoo, very nice note :P

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants