class_docstr: Beta distribution scaled by :attr:`scale` and shifted by :attr:`loc`::
  
      X ~ Beta(concentration1, concentration0)
      f(X) = loc + scale * X
      Y = f(X) ~ AffineBeta(concentration1, concentration0, loc, scale)
  
  :param concentration1: 1st concentration parameter
      (alpha) for the Beta distribution.
  :type concentration1: float or torch.Tensor
  :param concentration0: 2nd concentration parameter
      (beta) for the Beta distribution.
  :type concentration0: float or torch.Tensor
  :param loc: location parameter.
  :type loc: float or torch.Tensor
  :param scale: scale parameter.
  :type scale: float or torch.Tensor
docstr: Generates a sample from `Beta` distribution and applies `AffineTransform`.
  Additionally clamps the output in order to avoid `NaN` and `Inf` values
  in the gradients.
docstr_tok: ["Generates","a","sample","from","`","Beta","`","distribution","and","applies","`","AffineTransform","`",".","Additionally","clamps","the","output","in","order","to","avoid","`","NaN","`","and","`","Inf","`","values","in","the","gradients","."]
code: def rsample(self, sample_shape=torch.Size()):
      """
      Generates a sample from `Beta` distribution and applies `AffineTransform`.
      Additionally clamps the output in order to avoid `NaN` and `Inf` values
      in the gradients.
      """
      x = self.base_dist.rsample(sample_shape)
      for transform in self.transforms:
          x = transform(x)
      eps = torch.finfo(x.dtype).eps * self.scale
      x = torch.min(torch.max(x, self.low + eps), self.high - eps)
      return x
  
imports: import torch
  from torch.distributions import constraints
  from torch.distributions.transforms import AffineTransform
  from .torch import Beta, TransformedDistribution
  from .util import broadcast_shape
label_desc: Use image node_id 5 for calling the AffineBeta obj's underlying member method code with example usage: obj.rsample(sample_shape) and returns: x