Skip to content

with_data shape-change fix#287

Open
elc45 wants to merge 1 commit intopymc-devs:mainfrom
elc45:doc
Open

with_data shape-change fix#287
elc45 wants to merge 1 commit intopymc-devs:mainfrom
elc45:doc

Conversation

@elc45
Copy link
Contributor

@elc45 elc45 commented Mar 3, 2026

Check thoroughly if the dims of shared variables change when with_data method is called on a CompiledModel, and if so, throw an informative error. Should fix #267.

@ricardoV94
Copy link
Member

We should support this, so if anything raise a NotImplementedError

@aseyboldt
Copy link
Member

If the model wasn't frozen, we should be able to get away with some shape changes though? I guess we could check if the tensor type shapes match?

@ricardoV94
Copy link
Member

If the model wasn't frozen

Doesn't nutpie freeze the model by default now?

@aseyboldt
Copy link
Member

The default is to freeze jax models, but not numba models.
If we want to change the dataset of a model or some other shared variables it is nice if we can avoid having to recompile, and often that will involve changing the shape (of a dataset for instance) as well.

@ricardoV94
Copy link
Member

If the model isn't frozen, changing any shared variable that doesn't have static shape (all by default), should work fine. Something in nutpie is likely hardcoding the shape after freezing though, because in my MWE I'm not using jax backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nutpie fails to sample when RV changes shape following with_data

3 participants