class_docstr: Half-Cauchy distribution.
  
  The half-Cauchy distribution is parameterized by a `loc` and a
  `scale` parameter. It represents the right half of the two symmetric halves in
  a [Cauchy distribution](https://en.wikipedia.org/wiki/Cauchy_distribution).
  
  #### Mathematical Details
  The probability density function (pdf) for the half-Cauchy distribution
  is given by
  
  ```none
  pdf(x; loc, scale) = 2 / (pi scale (1 + z**2))
  z = (x - loc) / scale
  ```
  
  where `loc` is a scalar in `R` and `scale` is a positive scalar in `R`.
  
  The support of the distribution is given by the interval `[loc, infinity)`.
class_docstr_tok: ["Half-Cauchy","distribution",".","The","half-Cauchy","distribution","is","parameterized","by","a","`","loc","`","and","a","`","scale","`","parameter",".","It","represents","the","right","half","of","the","two","symmetric","halves","in","a","[","Cauchy","distribution","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Cauchy_distribution",")",".","#","#","#","#","Mathematical","Details","The","probability","density","function","(","pdf",")","for","the","half-Cauchy","distribution","is","given","by","``","`","none","pdf","(","x",";","loc",",","scale",")","=","2","\/","(","pi","scale","(","1","+","z","*","*","2",")",")","z","=","(","x","-","loc",")","\/","scale","``","`","where","`","loc","`","is","a","scalar","in","`","R","`","and","`","scale","`","is","a","positive","scalar","in","`","R","`",".","The","support","of","the","distribution","is","given","by","the","interval","`","[","loc",",","infinity",")","`","."]
docstr: Construct a half-Cauchy distribution with `loc` and `scale`.
  
  Args:
    loc: Floating-point `Tensor`; the location(s) of the distribution(s).
    scale: Floating-point `Tensor`; the scale(s) of the distribution(s).
      Must contain only positive values.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs. Default value: `False` (i.e. do not validate args).
    allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
      (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
      result is undefined. When `False`, an exception is raised if one or
      more of the statistic's batch members are undefined.
      Default value: `True`.
    name: Python `str` name prefixed to Ops created by this class.
      Default value: 'HalfCauchy'.
  
  Raises:
    TypeError: if `loc` and `scale` have different `dtype`.
docstr_tok: ["Construct","a","half-Cauchy","distribution","with","`","loc","`","and","`","scale","`",".","Args",":","loc",":","Floating-point","`","Tensor","`",";","the","location","(","s",")","of","the","distribution","(","s",")",".","scale",":","Floating-point","`","Tensor","`",";","the","scale","(","s",")","of","the","distribution","(","s",")",".","Must","contain","only","positive","values",".","validate_args",":","Python","`","bool","`",",","default","`","False","`",".","When","`","True","`","distribution","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance",".","When","`","False","`","invalid","inputs","may","silently","render","incorrect","outputs",".","Default","value",":","`","False","`","(","i.e",".","do","not","validate","args",")",".","allow_nan_stats",":","Python","`","bool","`",",","default","`","True","`",".","When","`","True","`",",","statistics","(","e.g.",",","mean",",","mode",",","variance",")","use","the","value","``","`","NaN","`","``","to","indicate","the","result","is","undefined",".","When","`","False","`",",","an","exception","is","raised","if","one","or","more","of","the","statistic","'s","batch","members","are","undefined",".","Default","value",":","`","True","`",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class",".","Default","value",":","'HalfCauchy","'",".","Raises",":","TypeError",":","if","`","loc","`","and","`","scale","`","have","different","`","dtype","`","."]
code: def __init__(
      self,
      loc,
      scale,
      validate_args=False,
      allow_nan_stats=True,
      name="HalfCauchy",
  ):
      """Construct a half-Cauchy distribution with `loc` and `scale`.
  
      Args:
        loc: Floating-point `Tensor`; the location(s) of the distribution(s).
        scale: Floating-point `Tensor`; the scale(s) of the distribution(s).
          Must contain only positive values.
        validate_args: Python `bool`, default `False`. When `True` distribution
          parameters are checked for validity despite possibly degrading runtime
          performance. When `False` invalid inputs may silently render incorrect
          outputs. Default value: `False` (i.e. do not validate args).
        allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
          (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
          result is undefined. When `False`, an exception is raised if one or
          more of the statistic's batch members are undefined.
          Default value: `True`.
        name: Python `str` name prefixed to Ops created by this class.
          Default value: 'HalfCauchy'.
  
      Raises:
        TypeError: if `loc` and `scale` have different `dtype`.
      """
      parameters = dict(locals())
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [loc, scale], dtype_hint=tf.float32
          )
          self._loc = tensor_util.convert_nonref_to_tensor(
              loc, name="loc", dtype=dtype
          )
          self._scale = tensor_util.convert_nonref_to_tensor(
              scale, name="scale", dtype=dtype
          )
          super(HalfCauchy, self).__init__(
              dtype=dtype,
              reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              parameters=parameters,
              name=name,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
label_desc: Use image node_id 1 to create a new HalfCauchy object from inherited base classes: distribution with example: obj = HalfCauchy(loc, scale, validate_args, allow_nan_stats, name)