autopdex.utility.reshape_as
- autopdex.utility.reshape_as(flat_array, signature_array)[source]
Reshapes a flat array (np.ndarray or jnp.ndarray) into an array or dict of arrays matching the structure of signature_array.
- Parameters:
flat_array (np.ndarray or jnp.ndarray) – The flat array to be reshaped.
signature_array (np.ndarray, jnp.ndarray, or dict) – An array or dict of arrays whose shapes are used to reshape flat_array.
- Returns:
Reshaped array or dict of arrays matching the shapes in signature_array.