class_docstr: Implicit Quantile Network Distribution Loss.
  
  Based on `Probabilistic Time Series Forecasting with Implicit Quantile Networks
  <https://arxiv.org/pdf/2107.03743.pdf>`_.
  A network is used to directly map network outputs to a quantile.
class_docstr_tok: ["Implicit","Quantile","Network","Distribution","Loss",".","Based","on","`","Probabilistic","Time","Series","Forecasting","with","Implicit","Quantile","Networks","<","https",":","\/\/arxiv.org\/pdf\/2107.03743.pdf",">","`","_",".","A","network","is","used","to","directly","map","network","outputs","to","a","quantile","."]
docstr: Convert network prediction into a quantile prediction.
  
  Args:
      y_pred: prediction output of network
      quantiles (List[float], optional): quantiles for probability range. Defaults to quantiles as
          as defined in the class initialization.
  
  Returns:
      torch.Tensor: prediction quantiles (last dimension)
docstr_tok: ["Convert","network","prediction","into","a","quantile","prediction",".","Args",":","y_pred",":","prediction","output","of","network","quantiles","(","List","[","float","]",",","optional",")",":","quantiles","for","probability","range",".","Defaults","to","quantiles","as","as","defined","in","the","class","initialization",".","Returns",":","torch.Tensor",":","prediction","quantiles","(","last","dimension",")"]
code: def to_quantiles(
      self, y_pred: torch.Tensor, quantiles: List[float] = None
  ) -> torch.Tensor:
      """
      Convert network prediction into a quantile prediction.
  
      Args:
          y_pred: prediction output of network
          quantiles (List[float], optional): quantiles for probability range. Defaults to quantiles as
              as defined in the class initialization.
  
      Returns:
          torch.Tensor: prediction quantiles (last dimension)
      """
      if quantiles is None:
          quantiles = self.quantiles
      quantiles = torch.as_tensor(quantiles, device=y_pred.device)
  
      # extract parameters
      x = y_pred[..., :-2]
      loc = y_pred[..., -2][..., None]
      scale = y_pred[..., -1][..., None]
  
      # predict quantiles
      if y_pred.requires_grad:
          predictions = self.quantile_network(x, quantiles)
      else:
          with torch.no_grad():
              predictions = self.quantile_network(x, quantiles)
      # rescale output
      predictions = loc + predictions * scale
      # transform output if required
      if self._transformation is not None:
          transform = TorchNormalizer.get_transform(
              self._transformation
          )["reverse"]
          predictions = transform(predictions)
  
      return predictions
  
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 6 for calling the ImplicitQuantileNetworkDistributionLoss obj's underlying member method code with example usage: obj.to_quantiles(y_pred, quantiles) and returns: predictions