gEconpy.model.compile.pack_and_compile#

gEconpy.model.compile.pack_and_compile(outputs, ss_nodes, param_dict=None, mode=None)#

Replace SS variable scalars with x_flat[i] indexing and compile.

Only SS nodes that are actual graph inputs are replaced. If param_dict is provided, parameter values are frozen into the closure and the returned function has signature f(x_flat); otherwise it is f(x_flat, *param_args).

Parameters:
outputsTensorVariable or list of TensorVariable

Graph outputs to compile.

ss_nodeslist of TensorVariable

All scalar SS variable nodes, defining the positional layout of x_flat.

param_dictSymbolDictionary, optional

Parameter values to freeze into the closure.

modestr, optional

Pytensor compilation mode.

Returns:
callable()

Compiled function.