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

Julia 0.7 version #8

Open
dfdx opened this issue May 31, 2018 · 0 comments
Open

Julia 0.7 version #8

dfdx opened this issue May 31, 2018 · 0 comments

Comments

@dfdx
Copy link

dfdx commented May 31, 2018

For anyone interested: in Julia 0.7 there's no more need in unfusing hack, instead one can overload broadcasting directly. The relevant section of manual is here. The shortest and simplest way to prevent fusion is to overload Broadcast.broadcasted (note -ed) method, e.g. for some custom type TrackedArray:

function Broadcast.broadcasted(::typeof(+), x::TrackedArray, y::TrackedArray)
    # do whatever you need
    return TrackedArray(...)   # eagerly return a new object, avoiding lazy fusion
end
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

No branches or pull requests

1 participant