Fix shape method for MVN
@@ -37,7 +37,8 @@ class _MultivariateNormalBase(TMultivariateNormal, Distribution):
self._covar = covariance_matrix
self.__unbroadcasted_scale_tril = None
self._validate_args = validate_args
- batch_shape, event_shape = self.loc.shape[:-1], self.loc.shape[-1:]
+ batch_shape = _mul_broadcast_shape(self.loc.shape[:-1], covariance_matrix.shape[:-2])
+ event_shape = self.loc.shape[-1:]
# TODO: Integrate argument validation for LazyTensors into torch.distribution validation logic
super(TMultivariateNormal, self).__init__(batch_shape, event_shape, validate_args=False)
else:
