Commit edd936e4 authored by Dan Moldovan's avatar Dan Moldovan Committed by TensorFlower Gardener
Browse files

Temporary patch: properly handle expressions in subscripts. The long term fix...

Temporary patch: properly handle expressions in subscripts. The long term fix is either of: (a) dropping support for tracking specific slices of a symbol (b) track slices along with the symbols on which they depend.

Background:
So far we tracked symbols like `a[b]` and allow conversions of the kind `if <cond>: a[b] = c` -> `a[b] = ag__.if_stmt(<cond>, lambda: c, lambda: a[b])`. That construct allowed a to be anything, including e.g. Python lists, objects. etc.
This is incomplete and will in the future become obsolete as we override the slice operator. In effect the statement above will be converted to `a = ag__.if_stmt(<cond>, lambda: ag__.set_item(a, b, c), lambda: a)`. However, this latter form does not support objects, so there is a tradeoff.
PiperOrigin-RevId: 199131573
parent 256ef423
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment