View source on GitHub |
Propagates inverse value slices and their ILDJs.
oryx.core.interpreters.inverse.core.InverseAndILDJ(
aval: jax_core.AbstractValue, slices: Iterable[NDSlice]
)
An InverseAndILDJ instance keeps track of a set of slices of a value. In the simplest case, the slice's indices capture the entire value, in which case the cell is "top". Partial information is represented with slices that do not capture the entire value. No information, i.e. "bottom', is represented with a cell that has no slices.
Joining two cells creates set of slices, and if we detect that the slices can
be concatenated, we combine them into a single slice. As propagation
progresses, we hope to accumulate enough slices to concatenate them all into
this cell's val
. ILDJs are also kept track of in the same way, except we
keep track of the diagonal of the Jacobian since split operations may also
split up the Jacobian.
Attributes | |
---|---|
ildj
|
|
ndim
|
|
shape
|
|
val
|
Methods
bottom
bottom() -> bool
Returns if this cell represents the bottom of the slice lattice.
An InverseAndILDJ is at the bottom if we have no slices.
flatten
flatten()
is_unknown
is_unknown()
join
join(
other: 'InverseAndILDJ'
) -> 'InverseAndILDJ'
new
@classmethod
new( val )
Creates a new instance of a Cell from a value.
top
top() -> bool
Returns if this cell represents the top of the slice lattice.
An InverseAndILDJ is at the top if its slice represents the entire array.
unflatten
@classmethod
unflatten( data, slices )
unknown
@classmethod
unknown( aval )
Creates an unknown Cell from an abstract value.
__eq__
__eq__(
other: 'InverseAndILDJ'
) -> bool
Return self==value.
__lt__
__lt__(
other: 'InverseAndILDJ'
) -> bool
Return self<value.