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)
code: def __init__(self, xi, beta, validate_args=None):
      self.xi, self.beta = broadcast_all(
          xi.squeeze(dim=-1), beta.squeeze(dim=-1)
      )
  
      setattr(self, "xi", xi)
      setattr(self, "beta", beta)
  
      super(GeneralizedPareto, self).__init__()
  
      if isinstance(xi, Number) and isinstance(beta, Number):
          batch_shape = torch.Size()
      else:
          batch_shape = self.xi.size()
      super(GeneralizedPareto, self).__init__(
          batch_shape, validate_args=validate_args
      )
  
      if (
          self._validate_args
          and not torch.lt(
              -self.beta, torch.zeros_like(self.beta)
          ).all()
      ):
          raise ValueError(
              "GenPareto is not defined when scale beta<=0"
          )
  
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 1 to create a new GeneralizedPareto object from inherited base classes: Distribution with example: obj = GeneralizedPareto(xi, beta, validate_args)