Closed michaelosthege closed 1 month ago
I'm still of the opinion we should drop generators altogether. I don't find any documentation on how to use it, and I can't really think of all the implications this Op means inside PyTensor, which is supposed to be side-effects free unless told otherwise (it's not being told so here). It's also only applicable in the default backend / and even here only if you have models without Deterministics (or any workflow where separate functions are compiled from the same underlying graph).
If this is useful in VI, the machinery that creates and call functions can use regular Python code to work with generators (such as setting a shared variable to the next value in every iteration of the loop). I don't see why we need this magic at the PyTensor level.
I'll add a depreaction warning to the conversion of generator data, asking people to get in touch if this is relevant.
floatX
conversion when user-provided data does not carry dtype
information.All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.45%. Comparing base (
a197b19
) to head (d9bd20c
). Report is 2 commits behind head on main.
Description
convert_observed_data
is a messy do-it-all conversion function that was recently refactored in #7299.This PR takes the next step and splits it such that generator data is treated separately.
Related Issue
Checklist
Type of change
pm.Data
.📚 Documentation preview 📚: https://pymc--7334.org.readthedocs.build/en/7334/