class_docstr: A distribution induced by applying a tanh transformation to a Gaussian random variable.
  
  Algorithms like SAC and Pearl use this transformed distribution.
  It can be thought of as a distribution of X where
      :math:`Y ~ \mathcal{N}(\mu, \sigma)`
      :math:`X = tanh(Y)`
  
  Args:
      loc (torch.Tensor): The mean of this distribution.
      scale (torch.Tensor): The stdev of this distribution.
class_docstr_tok: ["A","distribution","induced","by","applying","a","tanh","transformation","to","a","Gaussian","random","variable",".","Algorithms","like","SAC","and","Pearl","use","this","transformed","distribution",".","It","can","be","thought","of","as","a","distribution","of","X","where",":","math",":","`","Y","~","\\mathcal","{","N","}","(","\\mu",",","\\sigma",")","`",":","math",":","`","X","=","tanh","(","Y",")","`","Args",":","loc","(","torch.Tensor",")",":","The","mean","of","this","distribution",".","scale","(","torch.Tensor",")",":","The","stdev","of","this","distribution","."]
docstr: Return a sample, sampled from this TanhNormal Distribution.
  
  Args:
      sample_shape (list): Shape of the returned value.
  
  Note:
      Gradients `do not` pass through this operation.
  
  Returns:
      torch.Tensor: Sample from this TanhNormal distribution.
docstr_tok: ["Return","a","sample",",","sampled","from","this","TanhNormal","Distribution",".","Args",":","sample_shape","(","list",")",":","Shape","of","the","returned","value",".","Note",":","Gradients","`","do","not","`","pass","through","this","operation",".","Returns",":","torch.Tensor",":","Sample","from","this","TanhNormal","distribution","."]
code: def sample(self, sample_shape=torch.Size()):
      """Return a sample, sampled from this TanhNormal Distribution.
  
      Args:
          sample_shape (list): Shape of the returned value.
  
      Note:
          Gradients `do not` pass through this operation.
  
      Returns:
          torch.Tensor: Sample from this TanhNormal distribution.
  
      """
      with torch.no_grad():
          return self.rsample(sample_shape=sample_shape)
  
file_path: garage/src/garage/torch/distributions/tanh_normal.py
imports: import torch
  from torch.distributions import Normal
  from torch.distributions.independent import Independent
label_desc: Use image node_id 3 for calling the TanhNormal obj's underlying member method code with example usage: obj.sample(sample_shape) and returns: self