AbstractPPL.jl icon indicating copy to clipboard operation
AbstractPPL.jl copied to clipboard

Use views in concretization

Open phipsgabler opened this issue 4 years ago • 4 comments

To concretize, we need the runtime shapes, and to get them, we actually apply the lenses: https://github.com/TuringLang/AbstractPPL.jl/blob/9b64dd89dcde2dc0d8845cd01b4cc305ea83086e/src/varname.jl#L428

It would be good if this were only views. Related: https://github.com/TuringLang/DynamicPPL.jl/issues/341

phipsgabler avatar Feb 05 '22 16:02 phipsgabler

It would be nice if something like Base.maybeview was implemented for lenses

torfjelde avatar Feb 05 '22 16:02 torfjelde

Yea, I thought about this yesterday after writing. Maybe we can implement some utils locally and then ask the Setfield people whether they want them (although they explicitely exclude new stuff for Setfield, IIRC...)

phipsgabler avatar Feb 06 '22 11:02 phipsgabler

Fixed by https://github.com/TuringLang/AbstractPPL.jl/pull/43?

yebai avatar Nov 07 '22 11:11 yebai

No, it's not fixed, the implementation of get uses normal indexing (see linked issue).

phipsgabler avatar Nov 21 '22 09:11 phipsgabler