@@ -125,11 +125,11 @@ class TestMvNormalLogp():
125
125
def test_logp (self ):
126
126
np .random .seed (42 )
127
127
128
- chol_val = np .array ([[1 , 0.9 ], [0 , 2 ]])
129
- cov_val = np .dot (chol_val , chol_val .T )
128
+ chol_val = floatX ( np .array ([[1 , 0.9 ], [0 , 2 ]]) )
129
+ cov_val = floatX ( np .dot (chol_val , chol_val .T ) )
130
130
cov = tt .matrix ('cov' )
131
131
cov .tag .test_value = cov_val
132
- delta_val = np .random .randn (5 , 2 )
132
+ delta_val = floatX ( np .random .randn (5 , 2 ) )
133
133
delta = tt .matrix ('delta' )
134
134
delta .tag .test_value = delta_val
135
135
expect = stats .multivariate_normal (mean = np .zeros (2 ), cov = cov_val )
@@ -151,15 +151,15 @@ def func(chol_vec, delta):
151
151
cov = tt .dot (chol , chol .T )
152
152
return MvNormalLogp ()(cov , delta )
153
153
154
- chol_vec_val = np .array ([0.5 , 1. , - 0.1 ])
154
+ chol_vec_val = floatX ( np .array ([0.5 , 1. , - 0.1 ]) )
155
155
156
- delta_val = np .random .randn (1 , 2 )
156
+ delta_val = floatX ( np .random .randn (1 , 2 ) )
157
157
try :
158
158
utt .verify_grad (func , [chol_vec_val , delta_val ])
159
159
except ValueError as e :
160
160
print (e .args [0 ])
161
161
162
- delta_val = np .random .randn (5 , 2 )
162
+ delta_val = floatX ( np .random .randn (5 , 2 ) )
163
163
utt .verify_grad (func , [chol_vec_val , delta_val ])
164
164
165
165
@pytest .mark .skip (reason = "Fix in theano not released yet: Theano#5908" )
0 commit comments