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

Fix Base.zero type output #169

Merged
merged 2 commits into from
Aug 29, 2024
Merged

Fix Base.zero type output #169

merged 2 commits into from
Aug 29, 2024

Conversation

ChrisRackauckas
Copy link
Member

zero(x::T)::T is a standard that applies to pretty much any other array type, but TrackedArray fails to match the standard interfaces. This fixes that issue. The only major violation to where this behavior is expected is if you're trying to write a grad rule that's mutating, which really only shows up in rules libraries, and those are thus updated here.

Note that there is an alternative implementation via zero.(x), but this implementation drops the compute graph that isn't needed if you have a zero.

zero(x::T)::T is a standard that applies to pretty much any other array type, but TrackedArray fails to match the standard interfaces. This fixes that issue. The only major violation to where this behavior is expected is if you're trying to write a grad rule that's mutating, which really only shows up in rules libraries, and those are thus updated here.

Note that there is an alternative implementation via `zero.(x)`, but this implementation drops the compute graph that isn't needed if you have a zero.
Copy link
Contributor

github-actions bot commented Aug 29, 2024

Pull Request Test Coverage Report for Build 10607027541

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 75.564%

Totals Coverage Status
Change from base Build 8756063165: 0.03%
Covered Lines: 569
Relevant Lines: 753

💛 - Coveralls

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.56%. Comparing base (596f1c5) to head (a816377).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #169      +/-   ##
==========================================
+ Coverage   73.10%   75.56%   +2.46%     
==========================================
  Files           9       10       +1     
  Lines         725      753      +28     
==========================================
+ Hits          530      569      +39     
+ Misses        195      184      -11     

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

@ChrisRackauckas ChrisRackauckas merged commit fa1ca6d into master Aug 29, 2024
6 checks passed
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.

3 participants