class_docstr: Beta distribution.
  
  Parameters
  ----------
  alpha
      Tensor containing the alpha shape parameters, of shape
      `(*batch_shape, *event_shape)`.
  beta
      Tensor containing the beta shape parameters, of shape
      `(*batch_shape, *event_shape)`.
  F
class_docstr_tok: ["Beta","distribution",".","Parameters","--","--","--","--","--","alpha","Tensor","containing","the","alpha","shape","parameters",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`",".","beta","Tensor","containing","the","beta","shape","parameters",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`",".","F"]
code: def sample(
      self, num_samples: Optional[int] = None, dtype=np.float32
  ) -> Tensor:
      epsilon = np.finfo(dtype).eps  # machine epsilon
  
      def s(alpha: Tensor, beta: Tensor) -> Tensor:
          F = getF(alpha)
          samples_X = F.sample_gamma(
              alpha=alpha, beta=F.ones_like(alpha), dtype=dtype
          )
          samples_Y = F.sample_gamma(
              alpha=beta, beta=F.ones_like(beta), dtype=dtype
          )
          return samples_X / (samples_X + samples_Y)
  
      samples = _sample_multiple(
          s, alpha=self.alpha, beta=self.beta, num_samples=num_samples
      )
  
      return self.F.clip(data=samples, a_min=epsilon, a_max=1 - epsilon)
  
imports: from typing import Dict, List, Optional, Tuple
  import numpy
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from .distribution import Distribution, _sample_multiple, getF, softplus
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 10 for calling the Beta obj's underlying member method code with example usage: obj.sample(num_samples, dtype) and returns: self, unknown