-
-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Labels
Description
The following happens on Windows because constant integer lists default to int32 instead of int64 as on Linux.
import aesara.tensor as at
print(at.random.normal(size=1).owner.inputs[1]) # TensorConstant{(1,) of 1}
print(at.random.normal(size=(1,)).owner.inputs[1]) # SpecifyShape.0
print(at.random.normal(size=(1, 2)).owner.inputs[1]) # SpecifyShape.0
To replicate on Linux, one would need to:
print(at.random.normal(size=at.constant((1,), dtype='int32')).owner.inputs[1]) # SpecifyShape.0
print(at.random.normal(size=at.constant((1, 2), dtype='int32')).owner.inputs[1]) # SpecifyShape.0
This is not terrible in itself, but led to bigger issues in pymc-devs/pymc#5140 because of #692
Edit: Updated to mention this only happens when casting is involved, which is the case on Windows due to constants of integer lists defaulting to int32
. The bigger problem comes for #692, because some Ops like Alloc return a different output type when a shape is wrapped in a SpecifyShape.
As it stands the above is more of a nuisance than a bug. We might still not want to not apply SpecifyShape to casts of constants, specially since this will be the default on Windows.