class_docstr: Multivariate low-rank normal distribution loss.
  
  Use this loss to make out of a DeepAR model a DeepVAR network.
class_docstr_tok: ["Multivariate","low-rank","normal","distribution","loss",".","Use","this","loss","to","make","out","of","a","DeepAR","model","a","DeepVAR","network","."]
code: def map_x_to_distribution(
      self, x: torch.Tensor
  ) -> distributions.Normal:
      assert (
          x.device.type != "mps"
      ), "MPS accelerator has a bug https://github.com/pytorch/pytorch/issues/98074, use cpu or gpu"
      x = x.permute(1, 0, 2)
      distr = self.distribution_class(
          loc=x[..., 2],
          cov_factor=x[..., 4:],
          cov_diag=x[..., 3],
      )
      scaler = distributions.AffineTransform(
          loc=x[0, :, 0], scale=x[0, :, 1], event_dim=1
      )
      if self._transformation is None:
          return distributions.TransformedDistribution(distr, [scaler])
      else:
          return distributions.TransformedDistribution(
              distr,
              [
                  scaler,
                  TorchNormalizer.get_transform(self._transformation)[
                      "inverse_torch"
                  ],
              ],
          )
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  from sklearn.base import BaseEstimator
  import torch
  from torch import distributions, nn
  import torch.nn.functional
  from pytorch_forecasting.data.encoders import TorchNormalizer, softplus_inv
  from pytorch_forecasting.metrics.base_metrics import DistributionLoss, MultivariateDistributionLoss
label_desc: Use image node_id 2 for calling the MultivariateNormalDistributionLoss obj's underlying member method code with example usage: obj.map_x_to_distribution(x) and returns: distributions, distributions