mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-08-02 13:03:05 +08:00
MultivariateNormal expects named arguments
This commit is contained in:
@@ -222,6 +222,18 @@ class MultivariateNormalOutput(DistributionOutput):
|
||||
|
||||
return loc, scale_tril
|
||||
|
||||
def distribution(
|
||||
self, distr_args, scale: Optional[torch.Tensor] = None
|
||||
) -> Distribution:
|
||||
loc, scale_tri = distr_args
|
||||
distr = MultivariateNormal(loc=loc, scale_tril=scale_tri)
|
||||
|
||||
if scale is None:
|
||||
return distr
|
||||
else:
|
||||
return TransformedDistribution(distr, [AffineTransform(loc=0, scale=scale)])
|
||||
|
||||
|
||||
@property
|
||||
def event_shape(self) -> Tuple:
|
||||
return (self.dim,)
|
||||
|
||||
Reference in New Issue
Block a user