class_docstr: Generalised Pareto distribution.
  
  Parameters
  ----------
  xi
      Tensor containing the xi shape parameters, of shape
      `(*batch_shape, *event_shape)`.
  beta
      Tensor containing the beta scale parameters, of shape
      `(*batch_shape, *event_shape)`.
class_docstr_tok: ["Generalised","Pareto","distribution",".","Parameters","--","--","--","--","--","xi","Tensor","containing","the","xi","shape","parameters",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`",".","beta","Tensor","containing","the","beta","scale","parameters",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`","."]
code: def sample(
      self, num_samples: Optional[int] = None, dtype=np.float32
  ) -> Tensor:
      def s(xi: Tensor, beta: Tensor) -> Tensor:
          F = getF(xi)
          sample_U = uniform.Uniform(
              F.zeros_like(xi), F.ones_like(xi)
          ).sample()
          boxcox = box_cox_transform.BoxCoxTransform(-xi, F.array([0]))
          sample_X = -1 * boxcox.f(1 - sample_U) * beta
          return sample_X
  
      samples = _sample_multiple(
          s,
          xi=self.xi,
          beta=self.beta,
          num_samples=num_samples,
      )
      return self.F.clip(
          data=samples,
          a_min=np.finfo(dtype).eps,
          a_max=np.finfo(dtype).max,
      )
  
imports: from typing import Dict, List, Optional, Tuple
  import numpy
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.distribution import box_cox_transform, uniform
  from gluonts.mx.distribution.distribution import MAX_SUPPORT_VAL, _sample_multiple, getF, softplus
  from gluonts.mx.distribution.distribution_output import DistributionOutput
  from .distribution import Distribution
label_desc: Use image node_id 13 for calling the GenPareto obj's underlying member method code with example usage: obj.sample(num_samples, dtype) and returns: self, sample_X