Skip to content

Fail if a GlobalRef is being assigned to a Dual number. #39

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

YingboMa
Copy link
Owner

No description provided.

Co-authored-by: "Yingbo Ma" <mayingbo5@gmail.com>
Co-authored-by: "Shashi Gowda" <gowda@mit.edu>
@codecov-io
Copy link

codecov-io commented Jan 23, 2020

Codecov Report

Merging #39 into master will increase coverage by 0.49%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #39      +/-   ##
==========================================
+ Coverage   73.26%   73.75%   +0.49%     
==========================================
  Files           7        7              
  Lines         273      282       +9     
==========================================
+ Hits          200      208       +8     
- Misses         73       74       +1
Impacted Files Coverage Δ
src/custom_dispatch.jl 94.28% <80%> (-5.72%) ⬇️
src/dual_context.jl 90.56% <0%> (+1.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b0f8d4...e4925ff. Read the comment docs.

Co-authored-by: "Yingbo Ma" <mayingbo5@gmail.com>
Co-authored-by: "Shashi Gowda" <gowda@mit.edu>
@MikeInnes
Copy link

MikeInnes commented Jan 23, 2020

Note that this won't solve all leaks, e.g. if you have global ref = Real[0] and put a number in there while differentiating you'll get the same issue.

I could probably also get around this by, for example, doing global foo = [x::Dual] or global foo = SomeStruct(x::Dual) (and same for setfield issues).

@YingboMa
Copy link
Owner Author

I could probably also get around this by, for example, doing global foo = [x::Dual] or global foo = SomeStruct(x::Dual) (and same for setfield issues).

If the user wants to get a Dual, then it is the intended behavior.

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.

4 participants