gEconpy.model.compile.array_return_wrapper#
- gEconpy.model.compile.array_return_wrapper(f)#
Wrap a function to convert the output to a numpy array.
When working with compiled JAX functions, the output will be a JAX array. This wrapper converts the JAX array to a numpy array, which is expected by e.g. scipy.optimize routines.
- Parameters:
- f: Callable
The function to wrap
- Returns:
- inner:
Callable The wrapped function
- inner: