You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our transformation API functions check the arguments passed in: _check_args and you get a nice error message.
This is not true of our lax.primitives, e.g., np.sin(lambda x: x) gives an error from inside numpy about "data type not understood". Perhaps this is Ok, but I noticed that in the bind implementation we do check the type of arguments (but only if skip_checks is False).
If the invocation with bad arguments is under transformations even the find_top_trace inside bind will malfunction. In some cases this means that it will return None and the impl rule will be called. At least this means that you get the same error (from numpy). In other cases, it will simply "not see" the bad argument (because it only looks for Tracers).
Would it make sense to add the _check_args as part of bind, essentially removing the skip_checks guard from the type check? Or, if performance is a concern, have a flavor of checked_bind that is used in the API.
The text was updated successfully, but these errors were encountered:
Our transformation API functions check the arguments passed in: _check_args and you get a nice error message.
This is not true of our
lax.primitives
, e.g.,np.sin(lambda x: x)
gives an error from inside numpy about "data type not understood". Perhaps this is Ok, but I noticed that in the bind implementation we do check the type of arguments (but only ifskip_checks
is False).If the invocation with bad arguments is under transformations even the
find_top_trace
insidebind
will malfunction. In some cases this means that it will returnNone
and theimpl
rule will be called. At least this means that you get the same error (from numpy). In other cases, it will simply "not see" the bad argument (because it only looks for Tracers).Would it make sense to add the
_check_args
as part ofbind
, essentially removing theskip_checks
guard from the type check? Or, if performance is a concern, have a flavor ofchecked_bind
that is used in the API.The text was updated successfully, but these errors were encountered: