class_docstr: Distribution over affine transformations.
  
  By default, the distribution is effected by placing isotropic Gaussian priors
  over the `weights` and `bias` in this transformation: `y = weights @ x +
  bias`.
  
  #### Example
  
  ```python
  layer_dist = Affine(in_units=5, out_units=10)
  layer = layer_dist.sample(seed=tfp.random.sanitize_seed(0))
  y = layer(x)
  ```
class_docstr_tok: ["Distribution","over","affine","transformations",".","By","default",",","the","distribution","is","effected","by","placing","isotropic","Gaussian","priors","over","the","`","weights","`","and","`","bias","`","in","this","transformation",":","`","y","=","weights","@","x","+","bias","`",".","#","#","#","#","Example","``","`","python","layer_dist","=","Affine","(","in_units=5",",","out_units=10",")","layer","=","layer_dist.sample","(","seed=tfp.random.sanitize_seed","(","0",")",")","y","=","layer","(","x",")","``","`"]
docstr: Initialize the `Affine` distribution.
  
  Args:
    out_units: Integer Tensor. Number of output units.
    in_units: Integer Tensor. Number of input units.
    dtype: Dtype to use for the inner distributions.
    params_model_fn: Callable with signature `(out_units, in_units, dtype) ->
      model_fn`. A model functions (in the `JointDistributionCoroutine` sense)
      used to define the `weights` and `bias` random variables.
    name: Name to use for the ops defined by this distribution.
docstr_tok: ["Initialize","the","`","Affine","`","distribution",".","Args",":","out_units",":","Integer","Tensor",".","Number","of","output","units",".","in_units",":","Integer","Tensor",".","Number","of","input","units",".","dtype",":","Dtype","to","use","for","the","inner","distributions",".","params_model_fn",":","Callable","with","signature","`","(","out_units",",","in_units",",","dtype",")","-",">","model_fn","`",".","A","model","functions","(","in","the","`","JointDistributionCoroutine","`","sense",")","used","to","define","the","`","weights","`","and","`","bias","`","random","variables",".","name",":","Name","to","use","for","the","ops","defined","by","this","distribution","."]
code: def __init__(
      self,
      out_units,
      in_units,
      dtype=tf.float32,
      params_model_fn=_affine_normal_params_model_fn,
      name="Affine",
  ):
      """Initialize the `Affine` distribution.
  
      Args:
        out_units: Integer Tensor. Number of output units.
        in_units: Integer Tensor. Number of input units.
        dtype: Dtype to use for the inner distributions.
        params_model_fn: Callable with signature `(out_units, in_units, dtype) ->
          model_fn`. A model functions (in the `JointDistributionCoroutine` sense)
          used to define the `weights` and `bias` random variables.
        name: Name to use for the ops defined by this distribution.
      """
      parameters = dict(locals())
      model = functools.partial(
          params_model_fn, out_units, in_units, dtype
      )
      super().__init__(
          model,
          name=name,
          sample_dtype=AffineLayer(weights=dtype, bias=dtype),
      )
      self._parameters = parameters
  
imports: import collections
  import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import joint_distribution_coroutine
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.internal import vectorization_util
label_desc: Use image node_id 1 to create a new Affine object from inherited base classes: joint_distribution_coroutine with example: obj = Affine(out_units, in_units, dtype, params_model_fn, name)