class_docstr: Generalised Pareto distribution.
  
  Parameters
  ----------
  xi
      Tensor containing the xi (heaviness) shape parameters. The tensor is
      of shape (*batch_shape, 1)
  beta
      Tensor containing the beta scale parameters. The tensor is of
      shape (*batch_shape, 1)
docstr: Returns the variance of the distribution, of shape (*batch_shape,)
docstr_tok: ["Returns","the","variance","of","the","distribution",",","of","shape","(","*","batch_shape",",",")"]
code: def variance(self):
      """
      Returns the variance of the distribution, of shape (*batch_shape,)
      """
      xi, beta = self.xi, self.beta
      var = torch.where(
          xi < 1 / 2.0,
          torch.div(beta**2, torch.mul((1 - xi) ** 2, (1 - 2 * xi))),
          np.nan * torch.ones_like(xi),
      )
      return var
  
imports: from numbers import Number
  from typing import Dict, Optional, Tuple, cast
  import numpy
  import torch
  from torch.distributions import Distribution, constraints
  from torch.distributions.utils import broadcast_all
  from gluonts.core.component import validated
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 3 for calling the GeneralizedPareto obj's underlying member method code with example usage: obj.variance() and returns: var