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

Zygote breaks @isdefined #1527

Open
Pangoraw opened this issue Sep 27, 2024 · 0 comments
Open

Zygote breaks @isdefined #1527

Pangoraw opened this issue Sep 27, 2024 · 0 comments

Comments

@Pangoraw
Copy link
Contributor

julia> Zygote.gradient(1.0) do x # [email protected]
           if @isdefined(x)
               2x
           else
               3x
           end
       end
(3.0,)

This is problematic because

@info "hello" x

uses @isdefined for single variables like this and logging more complex expressions is now supported because of #1474. The problem might require fixes in IRTools as well which does not have a great support for this (it replaces undefs with IRTools.Undef()).

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