We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7836447 commit 931a5afCopy full SHA for 931a5af
pymc/pytensorf.py
@@ -78,9 +78,12 @@
78
]
79
80
81
-def convert_observed_data(data):
+def convert_observed_data(data) -> np.ndarray | Variable:
82
"""Convert user provided dataset to accepted formats."""
83
84
+ if isgenerator(data):
85
+ return floatX(generator(data))
86
+
87
if hasattr(data, "to_numpy") and hasattr(data, "isnull"):
88
# typically, but not limited to pandas objects
89
vals = data.to_numpy()
@@ -116,8 +119,6 @@ def convert_observed_data(data):
116
119
ret = data
117
120
elif sps.issparse(data):
118
121
- elif isgenerator(data):
- ret = generator(data)
122
else:
123
ret = np.asarray(data)
124
0 commit comments