get_cost_cache#

Build a cache of cost values for the bloq and its callees.

This can be useful to inspect how callees’ costs flow upwards in a given cost computation.

bloq

The bloq to seed the cost computation.

cost_key

A CostKey that specifies which cost to compute.

costs_cache

If provided, use this dictionary for initial cached cost values. Values in this dictionary will be preferred over computed values (even if they disagree). This dictionary will be mutated by the function. This dictionary will be returned by the function.

generalizer

If provided, run this function on each bloq in the call graph to dynamically modify attributes. If the function returns None, the bloq is ignored in the cost computation. If a sequence of generalizers is provided, each generalizer will be run in order.