Closed aseyboldt closed 3 days ago
Simpler example:
import pytensor.tensor as pt
import pytensor
x = pt.vector("x", shape=(5,))
out = x[np.random.randn(5) > 0].set(1)
func = pytensor.function([x], out, mode="NUMBA")
pytensor.dprint(func)
Simpler example:
import pytensor.tensor as pt import pytensor x = pt.vector("x", shape=(5,)) out = x[np.random.randn(5) > 0].set(1) func = pytensor.function([x], out, mode="NUMBA") pytensor.dprint(func)
That's relying on boolean inc_subtensor. After #1106 we could convert that to integer inc_subtensor with nonzero()
, although it may be worth implementing a special case for boolean
Description
This model runs partially in objectmode:
The
AdvancedSetSubtensor
nodes use object model in numba currently, but I think we should be able to implement those without too much trouble.