From 8bdeb76ef0b3869a06f1cdbfac07d1f22a43a031 Mon Sep 17 00:00:00 2001 From: Marvin Pfoertner Date: Mon, 24 Aug 2020 18:34:52 +0200 Subject: [PATCH] Exclude Normal distributions with operator mean and dense covariance --- src/probnum/core/random_variables/_normal.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/probnum/core/random_variables/_normal.py b/src/probnum/core/random_variables/_normal.py index fe9ddbcee6..82d95fae99 100644 --- a/src/probnum/core/random_variables/_normal.py +++ b/src/probnum/core/random_variables/_normal.py @@ -119,9 +119,7 @@ def __init__( # Method selection univariate = len(mean.shape) == 0 dense = isinstance(mean, np.ndarray) and isinstance(cov, np.ndarray) - operator = isinstance(mean, linops.LinearOperator) or isinstance( - cov, linops.LinearOperator - ) + operator = isinstance(cov, linops.LinearOperator) if univariate: # Univariate Gaussian @@ -563,12 +561,7 @@ def _operatorvariate_params_todense(self): else: mean = self._mean - if isinstance(self._cov, linops.LinearOperator): - cov = self._cov.todense() - else: - cov = self._cov - - return mean, cov + return mean, self._cov.todense() def _operatorvariate_sample(self, size=()) -> np.ndarray: mean, cov = self._operatorvariate_params_todense()