class_docstr: Distribution class for the Incremental (Spline) Quantile Function in the
  paper ``Learning Quantile Functions without Quantile Crossing for
  Distribution-free Time Series Forecasting``
  by Park, Robinson, Aubet, Kan, Gasthaus, Wang
  Parameters
  ----------
  spline_knots, spline_heights
      Tensor parametrizing the x-positions (y-positions) of the spline knots
      Shape: (*batch_shape, (num_qk-1), num_pieces)
  qk_x, qk_y
      Tensor containing the increasing x-positions (y-positions) of the
      quantile knots, Shape: (*batch_shape, num_qk)
  beta_l, beta_r
      Tensor containing the non-negative learnable parameter of the
      left (right) tail, Shape: (*batch_shape,)
class_docstr_tok: ["Distribution","class","for","the","Incremental","(","Spline",")","Quantile","Function","in","the","paper","``","Learning","Quantile","Functions","without","Quantile","Crossing","for","Distribution-free","Time","Series","Forecasting","``","by","Park",",","Robinson",",","Aubet",",","Kan",",","Gasthaus",",","Wang","Parameters","--","--","--","--","--","spline_knots",",","spline_heights","Tensor","parametrizing","the","x-positions","(","y-positions",")","of","the","spline","knots","Shape",":","(","*","batch_shape",",","(","num_qk-1",")",",","num_pieces",")","qk_x",",","qk_y","Tensor","containing","the","increasing","x-positions","(","y-positions",")","of","the","quantile","knots",",","Shape",":","(","*","batch_shape",",","num_qk",")","beta_l",",","beta_r","Tensor","containing","the","non-negative","learnable","parameter","of","the","left","(","right",")","tail",",","Shape",":","(","*","batch_shape",",",")"]
code: def quantile_spline(
      self,
      alpha: torch.Tensor,
      dim: Optional[int] = None,
  ) -> torch.Tensor:
      # Refer to the description in quantile_internal
  
      qk_y = self.qk_y
      sk_x, delta_sk_x, delta_sk_y = (
          self.sk_x,
          self.delta_sk_x,
          self.delta_sk_y,
      )
  
      if dim is not None:
          qk_y = qk_y.unsqueeze(dim=0 if dim == 0 else -1)
          sk_x = sk_x.unsqueeze(dim=dim)
          delta_sk_x = delta_sk_x.unsqueeze(dim=dim)
          delta_sk_y = delta_sk_y.unsqueeze(dim=dim)
  
      if dim is None or dim == 0:
          alpha = alpha.unsqueeze(dim=-1)
  
      alpha = alpha.unsqueeze(dim=-1)
  
      spline_val = (alpha - sk_x) / delta_sk_x
      spline_val = torch.maximum(
          torch.minimum(spline_val, torch.ones_like(spline_val)),
          torch.zeros_like(spline_val),
      )
  
      return qk_y + torch.sum(spline_val * delta_sk_y, dim=-1)
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn.functional
  from torch.distributions import AffineTransform, TransformedDistribution
  from gluonts.core.component import validated
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 7 for calling the ISQF obj's underlying member method code with example usage: obj.quantile_spline(alpha, dim) and returns: unknown