aeppl.abstract.assign_custom_measurable_outputs#

aeppl.abstract.assign_custom_measurable_outputs(node, measurable_outputs_fn=<function noop_measurable_outputs_fn>, type_prefix='Unmeasurable')[source]#

Assign a custom _get_measurable_outputs dispatch function to a measurable variable instance.

The node is cloned and a custom Op that’s a copy of the original node’s Op is created. That custom Op replaces the old Op in the cloned node, and then a custom dispatch implementation is created for the clone Op in _get_measurable_outputs.

If measurable_outputs_fn isn’t specified, a no-op is used; the result is a clone of node that will effectively be ignored by factorized_joint_logprob.

Parameters
  • node (Apply) – The node to recreate with a new cloned Op.

  • measurable_outputs_fn (Callable) – The function that will be assigned to the new cloned Op in the _get_measurable_outputs dispatcher. The default is a no-op function (i.e. no measurable outputs)

  • type_prefix (str) – The prefix used for the new type’s name. The default is "Unmeasurable", which matches the default "measurable_outputs_fn".

Return type

Apply