ENH: lazy_xp_function
support for wrapped return values
#270
Labels
Milestone
lazy_xp_function
support for wrapped return values
#270
scipy.stats.ttest_ind
fails when wrapped withlazy_xp_function
.The reason is that the function returns a custom subclass of NamedTuple.
@jax.jit
automatically repacks returned lists, tuples, and NamedTuples of arrays, but fails with custom classes.This however is an artefact specific of
lazy_xp_function
; in real life, end users will unpack and consume the return value ofttest_ind
within the scope of the jit.In other words, this fails:
as it is equivalent to
However, in real-life users will not write the above, but will write instead something like
Proposed design
Use pickle hooks to automatically unpack and repack complex return values.
The text was updated successfully, but these errors were encountered: