Skip to content
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

[PyTorch] Adds torch ops (glu + hstack + remainder) #1614

Merged
merged 3 commits into from
Sep 27, 2022

Conversation

junpeiz
Copy link
Collaborator

@junpeiz junpeiz commented Sep 26, 2022

Adds three operators to PyTorch model conversion:

  • glu
  • hstack
  • remainder

Test cases also added for those ops.

CI: https://gitlab.com/coremltools1/coremltools/-/pipelines/651060438

Copy link
Collaborator

@TobyRoseman TobyRoseman left a comment

Choose a reason for hiding this comment

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

Great change. Thanks @junpeiz.

Applies the gated linear unit function GLU(a,b)=a⊗σ(b) where a is the first half of the input matrices and b is the
second half.
"""
assert len(node.outputs) == 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this assert necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I was following other ops when I added this assert and I had similar questions about the necessity :)

I will do a follow up PR to clean up those unnecessary asserts. Thanks!

@junpeiz junpeiz merged commit c8bb939 into apple:main Sep 27, 2022
@junpeiz junpeiz deleted the add-torch-ops branch September 27, 2022 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants