docstr: Returns the MQF2Distribution instance.
  
  Parameters
  ----------
  picnn
      A SequentialNet instance of a
      partially input convex neural network (picnn)
  hidden_state
      RNN hidden state (batch_size, context_length, hidden_size)
  scale
      scaling of the data (batch_size, 1)
  inference
      If True, pass only the last hidden state
      to the forecaster for prediction
      Otherwise, pass all the hidden states to train the forecaster
  
  Returns
  -------
  MQF2Distribution instance
      MQF2 parametrized by hidden_state
docstr_tok: ["Returns","the","MQF2Distribution","instance",".","Parameters","--","--","--","--","--","picnn","A","SequentialNet","instance","of","a","partially","input","convex","neural","network","(","picnn",")","hidden_state","RNN","hidden","state","(","batch_size",",","context_length",",","hidden_size",")","scale","scaling","of","the","data","(","batch_size",",","1",")","inference","If","True",",","pass","only","the","last","hidden","state","to","the","forecaster","for","prediction","Otherwise",",","pass","all","the","hidden","states","to","train","the","forecaster","Returns","--","--","--","-","MQF2Distribution","instance","MQF2","parametrized","by","hidden_state"]
code: def output_distribution(
      self,
      picnn: SequentialNet,
      hidden_state: torch.Tensor,
      scale: Optional[torch.Tensor] = None,
      inference: bool = False,
  ) -> torch.distributions.Distribution:
      """
      Returns the MQF2Distribution instance.
  
      Parameters
      ----------
      picnn
          A SequentialNet instance of a
          partially input convex neural network (picnn)
      hidden_state
          RNN hidden state (batch_size, context_length, hidden_size)
      scale
          scaling of the data (batch_size, 1)
      inference
          If True, pass only the last hidden state
          to the forecaster for prediction
          Otherwise, pass all the hidden states to train the forecaster
  
      Returns
      -------
      MQF2Distribution instance
          MQF2 parametrized by hidden_state
      """
  
      if inference:
          hidden_state = hidden_state[:, -1]
  
      return self.distr_output.distribution(
          picnn, hidden_state, scale=scale
      )
  
file_path: gluonts/src/gluonts/torch/model/mqf2/module.py
imports: from typing import List, Optional
  import torch
  from gluonts.core.component import validated
  from gluonts.torch.model.deepar.module import DeepARModel
  from cpflows.flows import ActNorm
  from cpflows.icnn import PICNN
  from .distribution import MQF2DistributionOutput
  from .icnn_utils import DeepConvexNet, SequentialNet
label_desc: Use image node_id 2 for calling the MQF2MultiHorizonModel obj's underlying member method code with example usage: obj.output_distribution(picnn, hidden_state, scale, inference) and returns: self