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

Tape BoundsError using dictionaries #34

Closed
MikeInnes opened this issue Apr 5, 2019 · 2 comments
Closed

Tape BoundsError using dictionaries #34

MikeInnes opened this issue Apr 5, 2019 · 2 comments

Comments

@MikeInnes
Copy link

julia> d = Dict()
Dict{Any,Any} with 0 entries

julia> grad(5) do x
         d[:x] = x
         d[:x] * d[:x]
       end
ERROR: BoundsError: attempt to access 8-element Array{Yota.AbstractOp,1} at index [-1]
@dfdx
Copy link
Owner

dfdx commented Apr 7, 2019

Unfortunately, Yota is not supposed to work with mutating operations (except for a limited list of known functions that are converted to non-mutating before processing). May I ask what's the use case for this example? Or are you just examining Cassette-based tracer to incorporate something similar to Zygote?

@MikeInnes
Copy link
Author

No particular use case, only curious how this would behave. I'm a bit surprised you wouldn't want to support this, as it's the kind of thing that a tracing AD can support quite well just by ignoring these operations (compared to a source approach which has to deal with them explicitly).

If that's the case though, fine to interpret this as a docs / error messages issue.

@dfdx dfdx closed this as completed Jul 3, 2021
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

2 participants