(self, replacements)
return _custom_getter(getter)
Replace attributes of this `ParameterizableModule` with `replacements`.

    Args:
      replacements: A dictionary mapping `Reference`s to replacement Tensors.

    Returns:
        A context manager; attributes are replaced according to
        `replacements` within its context.
Replace attributes of this `ParameterizableModule` with `replacements`.
Replace attributes of this ParameterizableModule with replacements .
def reparameterize(self, replacements):
    """Replace attributes of this `ParameterizableModule` with `replacements`.

    Args:
      replacements: A dictionary mapping `Reference`s to replacement Tensors.

    Returns:
        A context manager; attributes are replaced according to
        `replacements` within its context.
    """

    def getter(v_source):
      """Return `v_source` or its replacement if specified in `replacements`."""
      try:
        source_ref = v_source.ref()
        v_sink = replacements[source_ref]
        return v_sink
      except KeyError:
        # `v_source` was not a member of the `replacements` dictionary; this
        # could occur if `ReparameterizableModule.reparameterizables` was
        # called with a predicate that returns `False` of `v_source` and was
        # used to produce the `replacements` dictionary.
        return v_source
      except (AttributeError, TypeError):
        # `v_source` is not a `tf.Tensor` and so does not have an
        # `ref` API; it could not have been replaced.
        return v_source

    return _custom_getter(getter)
def reparameterize ( self , replacements ) : def getter ( v_source ) : """Return `v_source` or its replacement if specified in `replacements`.""" try : source_ref = v_source . ref ( ) v_sink = replacements [ source_ref ] return v_sink except KeyError : # `v_source` was not a member of the `replacements` dictionary; this # could occur if `ReparameterizableModule.reparameterizables` was # called with a predicate that returns `False` of `v_source` and was # used to produce the `replacements` dictionary. return v_source except ( AttributeError , TypeError ) : # `v_source` is not a `tf.Tensor` and so does not have an # `ref` API; it could not have been replaced. return v_source return _custom_getter ( getter )