Closed
Description
Background
pm.Data
is often used to track data in the model, making it end up in the InferenceData
and so on.
Right now this always creates shared variables, but in the vast majority of applications one doesn't actually use the shared variable features.
Generally there are three (?) flavors of data variables:
- constant (could be a
TensorConstant
instead) - shared with constant shape
- shared with flexible shape (constant ndim)
AFAIK Aesara does not distinguish between shared variables that can, or cannot be resized.
Motivation
But the difference between TensorConstant
and SharedVariable
is a thing, and sometimes also costly.
For example see #3818
Potential solution
- Additional kwargs to
pm.Data
through which one can constrain the flexibility (creatingTensorConstant
instead). - Automatically replacing all
SharedVariable
s in the graph withTensorConstant
before starting MCMC.
Versions and main components
- PyMC/PyMC3 Version:
main