Closed as not planned
Description
Would make dprint more readable
import aesara
import pymc as pm
with pm.Model(coords=dict(cities=range(5))) as m:
x = pm.Normal("x", dims=("cities"))
aesara.dprint(x)
normal_rv{0, (0, 0), floatX, False}.1 [id A] 'x'
|RandomStateSharedVariable(<RandomState(MT19937) at 0x7FF40F93C540>) [id B]
|SpecifyShape [id C] ''
| |MakeVector{dtype='int64'} [id D] ''
| | |<TensorType(int64, ())> [id E] <- Cryptic variable!
| |TensorConstant{(1,) of 1} [id F]
|TensorConstant{11} [id G]
|TensorConstant{0} [id H]
|TensorConstant{1.0} [id I]
Instead we could give it a name (doing it manually here for illustration):
with pm.Model(coords=dict(cities=range(5))) as m:
size = aesara.shared(len(m.coords), name="cities_dim")
x = pm.Normal("x", size=(size,))
aesara.dprint(x)
normal_rv{0, (0, 0), floatX, False}.1 [id A] 'x'
|RandomStateSharedVariable(<RandomState(MT19937) at 0x7FF408D8E140>) [id B]
|SpecifyShape [id C] ''
| |MakeVector{dtype='int64'} [id D] ''
| | |cities_dim [id E] <- Readable variable name
| |TensorConstant{(1,) of 1} [id F]
|TensorConstant{11} [id G]
|TensorConstant{0} [id H]
|TensorConstant{1.0} [id I]