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

Implement tensor.recip() function to calculate elementwise reciprocals #953

Merged
merged 6 commits into from
Nov 15, 2023

Conversation

gzsombor
Copy link
Contributor

@gzsombor gzsombor commented Nov 13, 2023

Pull Request Template

Checklist

  • Confirm that run-checks script has been executed.

Related Issues/PRs

Provide links to relevant issues and dependent PRs.

Changes

There was no recip() method on the tensor, which is a common feature in other tensor libraries to calculate elementwise reciprocals.

Testing

Unit tests

@gzsombor gzsombor changed the title Implement tensor.recip() function to calculate elementwise reciprocs Implement tensor.recip() function to calculate elementwise reciprocals Nov 13, 2023
@antimora
Copy link
Collaborator

Could we also please update the following documentation with the new tensor op?

  1. https://github.com/burn-rs/burn/blob/main/burn-import/SUPPORTED-ONNX-OPS.md (source)
  2. https://burn.dev/book/building-blocks/tensor.html (source)

@gzsombor
Copy link
Contributor Author

Could we also please update the following documentation with the new tensor op?

1. https://github.com/burn-rs/burn/blob/main/burn-import/SUPPORTED-ONNX-OPS.md ([source](https://github.com/antimora/burn/blob/1f531422c9590da231f6f3fc00ab011fa55c21df/burn-import/SUPPORTED-ONNX-OPS.md#L137))

2. https://burn.dev/book/building-blocks/tensor.html ([source](https://github.com/antimora/burn/blob/1f531422c9590da231f6f3fc00ab011fa55c21df/burn-book/src/building-blocks/tensor.md#L63))

I updated both, I hope, this makes sense

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (e882d41) 87.34% compared to head (b55995e) 87.37%.

Files Patch % Lines
burn-autodiff/src/ops/tensor.rs 95.65% 1 Missing ⚠️
burn-wgpu/src/ops/float_ops.rs 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #953      +/-   ##
==========================================
+ Coverage   87.34%   87.37%   +0.03%     
==========================================
  Files         493      495       +2     
  Lines       50132    50269     +137     
==========================================
+ Hits        43788    43923     +135     
- Misses       6344     6346       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

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

Overall looks good. One unit test is missing for autodiff.

@nathanielsimard would know more about the fusion part since it's new to me.

burn-autodiff/src/ops/tensor.rs Outdated Show resolved Hide resolved
Copy link
Member

@nathanielsimard nathanielsimard left a comment

Choose a reason for hiding this comment

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

LGTM ! Thanks for the contribution :)

Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

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

Thank you! Approved.

@gzsombor
Copy link
Contributor Author

Welcome! And thank you for the quick reviews!

@nathanielsimard nathanielsimard merged commit 4fc0c27 into tracel-ai:main Nov 15, 2023
8 checks passed
@gzsombor gzsombor deleted the recip branch November 15, 2023 21:28
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.

None yet

3 participants