Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Catch BackendNotImplementedError raised from __ua_function__ #199
This catches any
This gives errors such as
I think not, those failed gracefully.
That could be useful.
In theory, if
In : %timeit scipy.fft.fft(x) 4.43 µs ± 171 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
In : %timeit scipy.fft.fft(x) 4.31 µs ± 194 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
Both are within 1 sigma so hard to say if it's made a difference.
If I add a backend that unconditionally fails then things definitely slow down but it's hard to say how much of that is from returning vs raising.
class Backend: __ua_domain__ = 'numpy.scipy.fft' @staticmethod def __ua_function__(f, a, kw): return NotImplemented # on master raise ua.BackendNotImplementedError # on this PR