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: Construct a new TanhNormal distribution from a normal distribution.
  
  Args:
      new_normal (Independent(Normal)): underlying normal dist for
          the new TanhNormal distribution.
  
  Returns:
      TanhNormal: A new distribution whose underlying normal dist
          is new_normal.
docstr_tok: ["Construct","a","new","TanhNormal","distribution","from","a","normal","distribution",".","Args",":","new_normal","(","Independent","(","Normal",")",")",":","underlying","normal","dist","for","the","new","TanhNormal","distribution",".","Returns",":","TanhNormal",":","A","new","distribution","whose","underlying","normal","dist","is","new_normal","."]
code: def _from_distribution(cls, new_normal):
      """Construct a new TanhNormal distribution from a normal distribution.
  
      Args:
          new_normal (Independent(Normal)): underlying normal dist for
              the new TanhNormal distribution.
  
      Returns:
          TanhNormal: A new distribution whose underlying normal dist
              is new_normal.
  
      """
      # pylint: disable=protected-access
      new = cls(torch.zeros(1), torch.zeros(1))
      new._normal = new_normal
      return new
  
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 8 for calling the TanhNormal obj's underlying member method code with example usage: obj._from_distribution(cls, new_normal) and returns: new