Skip to content

Don't mask inputs to pm.Data containers #6189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pymc/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

import pymc as pm

from pymc.aesaraf import convert_observed_data

__all__ = [
"get_data",
"GeneratorAdapter",
Expand Down Expand Up @@ -668,9 +666,10 @@ def Data(
)
name = model.name_for(name)

# `convert_observed_data` takes care of parameter `value` and
# transforms it to something digestible for Aesara.
arr = convert_observed_data(value)
# Conversion to floatX is important to avoid having another conversion when the variable
# is used for observed somewhere. This breaks identification of the pm.Data variables
# as observed data, which is a Problem for model_to_graphviz and posterior predictive sampling.
arr = pm.floatX(value)

if mutable is None:
warnings.warn(
Expand Down