Skip to content

Commit a8b4d70

Browse files
authored
Merge pull request #1753 from pymc-devs/fix_types_lkj
LKJ should not convert input parameters to tensor and use theano floatX
2 parents d2289c2 + d348b40 commit a8b4d70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pymc3/distributions/multivariate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,13 @@ class LKJCorr(Continuous):
569569
"""
570570

571571
def __init__(self, n, p, *args, **kwargs):
572-
self.n = n = tt.as_tensor_variable(n)
573-
self.p = p = tt.as_tensor_variable(p)
572+
self.n = n
573+
self.p = p
574574
n_elem = int(p * (p - 1) / 2)
575-
self.mean = np.zeros(n_elem)
575+
self.mean = np.zeros(n_elem, dtype=theano.config.floatX)
576576
super(LKJCorr, self).__init__(shape=n_elem, *args, **kwargs)
577577

578-
self.tri_index = np.zeros([p, p], dtype=int)
578+
self.tri_index = np.zeros([p, p], dtype='int32')
579579
self.tri_index[np.triu_indices(p, k=1)] = np.arange(n_elem)
580580
self.tri_index[np.triu_indices(p, k=1)[::-1]] = np.arange(n_elem)
581581

0 commit comments

Comments
 (0)