Skip to content

Commit

Permalink
Closes pymc-devs#3051 - logp numpy array input- fixed
Browse files Browse the repository at this point in the history
Converts 'int' type to <TensorType(int64,Scalar)> to parse value to `astype` and allows arguments to `logp(self,value)` when called with numpy array.
  • Loading branch information
Ahanmr authored Mar 18, 2020
1 parent e2979a3 commit 6ae7f20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymc3/distributions/multivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def logp(self, value):
TensorVariable
"""
quaddist, logdet, ok = self._quaddist(value)
k = value.shape[-1].astype(theano.config.floatX)
k = theano.shared(value).shape[-1].astype(theano.config.floatX)
norm = - 0.5 * k * pm.floatX(np.log(2 * np.pi))
return bound(norm - 0.5 * quaddist - logdet, ok)

Expand Down Expand Up @@ -441,7 +441,7 @@ def logp(self, value):
TensorVariable
"""
quaddist, logdet, ok = self._quaddist(value)
k = value.shape[-1].astype(theano.config.floatX)
k = theano.shared(value).shape[-1].astype(theano.config.floatX)

norm = (gammaln((self.nu + k) / 2.)
- gammaln(self.nu / 2.)
Expand Down

0 comments on commit 6ae7f20

Please sign in to comment.