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",",",")"]
docstr: Compute CRPS in analytical form for the spline
  Parameters
  ----------
  z
      Observation to evaluate. shape = (*batch_shape,)
  Returns
  -------
  Tensor
      Tensor containing the CRPS, of the same shape as z
docstr_tok: ["Compute","CRPS","in","analytical","form","for","the","spline","Parameters","--","--","--","--","--","z","Observation","to","evaluate",".","shape","=","(","*","batch_shape",",",")","Returns","--","--","--","-","Tensor","Tensor","containing","the","CRPS",",","of","the","same","shape","as","z"]
code: def crps_spline(self, z: torch.Tensor) -> torch.Tensor:
      r"""
      Compute CRPS in analytical form for the spline
      Parameters
      ----------
      z
          Observation to evaluate. shape = (*batch_shape,)
      Returns
      -------
      Tensor
          Tensor containing the CRPS, of the same shape as z
      """
  
      qk_x, qk_x_plus, qk_y = self.qk_x, self.qk_x_plus, self.qk_y
      sk_x, sk_x_plus = self.sk_x, self.sk_x_plus
      delta_sk_x, delta_sk_y = self.delta_sk_x, self.delta_sk_y
  
      z_expand = z.unsqueeze(dim=-1)
      qk_x_plus_expand = qk_x_plus.unsqueeze(dim=-1)
  
      alpha_tilde = self.cdf_spline(z)
      alpha_tilde_expand = alpha_tilde.unsqueeze(dim=-1)
  
      r = torch.minimum(
          torch.maximum(alpha_tilde_expand, sk_x), sk_x_plus
      )
  
      coeff1 = (
          -2 / 3 * sk_x_plus**3
          + sk_x * sk_x_plus**2
          + sk_x_plus**2
          - (1 / 3) * sk_x**3
          - 2 * sk_x * sk_x_plus
          - r**2
          + 2 * sk_x * r
      )
  
      coeff2 = (
          -2 * torch.maximum(alpha_tilde_expand, sk_x_plus)
          + sk_x_plus**2
          + 2 * qk_x_plus_expand
          - qk_x_plus_expand**2
      )
  
      result = (
          (qk_x_plus**2 - qk_x**2) * (z_expand - qk_y)
          + 2 * (qk_x_plus - alpha_tilde) * (qk_y - z_expand)
          + torch.sum((delta_sk_y / delta_sk_x) * coeff1, dim=-1)
          + torch.sum(delta_sk_y * coeff2, dim=-1)
      )
  
      return torch.sum(result, 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 12 for calling the ISQF obj's underlying member method code with example usage: obj.crps_spline(z) and returns: torch