Skip to content

Commit b182686

Browse files
committed
eval for the observed_data group
1 parent 7f71397 commit b182686

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pymc/pytensorf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ def extract_obs_data(x: TensorVariable) -> np.ndarray:
177177
mask[mask_idx] = 1
178178
return np.ma.MaskedArray(array_data, mask)
179179

180+
from pymc.data import has_random_ancestor
181+
182+
if not has_random_ancestor(x):
183+
return x.eval()
184+
180185
raise TypeError(f"Data cannot be extracted from {x}")
181186

182187

0 commit comments

Comments
 (0)