def METHOD_NAME(
    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)