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
ENH: on failure, the normalizer decorator either raise (default) or return a value
On failure, @ normalizer without arguments (default) raises, while
@Normalizer(return_or_failure=value) return a specified `value`.
This is useful, e.g. for
@-normalizer
def is_scalar(a: ArrayLike):
....
Consider is_scalar(int): the argument cannot be converted to tensor, so
the function returns False. But the actual failure is in the decorator,
so cannot do try-except in the body of the function!
0 commit comments