Vectorized call to `func` over positional `args`.
(self, func, args)
| 2441 | return ufunc, otypes |
| 2442 | |
| 2443 | def _vectorize_call(self, func, args): |
| 2444 | """Vectorized call to `func` over positional `args`.""" |
| 2445 | if self.signature is not None: |
| 2446 | res = self._vectorize_call_with_signature(func, args) |
| 2447 | elif not args: |
| 2448 | res = func() |
| 2449 | else: |
| 2450 | ufunc, otypes = self._get_ufunc_and_otypes(func=func, args=args) |
| 2451 | |
| 2452 | # Convert args to object arrays first |
| 2453 | inputs = [asanyarray(a, dtype=object) for a in args] |
| 2454 | |
| 2455 | outputs = ufunc(*inputs) |
| 2456 | |
| 2457 | if ufunc.nout == 1: |
| 2458 | res = asanyarray(outputs, dtype=otypes[0]) |
| 2459 | else: |
| 2460 | res = tuple([asanyarray(x, dtype=t) |
| 2461 | for x, t in zip(outputs, otypes)]) |
| 2462 | return res |
| 2463 | |
| 2464 | def _vectorize_call_with_signature(self, func, args): |
| 2465 | """Vectorized call over positional arguments with a signature.""" |
no test coverage detected