class_docstr: Implementation of ``Dirichlet`` via ``Gamma``.
  
  This naive implementation has stochastic reparameterized gradients, which
  have higher variance than PyTorch's ``Dirichlet`` implementation.
class_docstr_tok: ["Implementation","of","``","Dirichlet","``","via","``","Gamma","``",".","This","naive","implementation","has","stochastic","reparameterized","gradients",",","which","have","higher","variance","than","PyTorch","'s","``","Dirichlet","``","implementation","."]
code: def rsample(self, sample_shape=torch.Size()):
      gammas = self._gamma.rsample(sample_shape)
      return gammas / gammas.sum(-1, True)
  
file_path: pyro/pyro/distributions/testing/naive_dirichlet.py
imports: import torch
  from pyro.distributions.torch import Beta, Dirichlet, Gamma
  from pyro.distributions.util import copy_docs_from
label_desc: Use image node_id 2 for calling the NaiveDirichlet obj's underlying member method code with example usage: obj.rsample(sample_shape) and returns: unknown