For what it's worth, I ended up defining a function like:
cdef np.broadcast broadcast(object a, object b):
"""
Broadcast the inputs into a multiIterator object.
the input can be a scalar, list, tuple or numpy array or array_like
object.
"""
cdef bint is_a_seq = is_sequence(h)
Sebastian Berg wrote
> On Sun, 2021-01-10 at 09:59 -0700, zoj613 wrote:
>> Hi all,
>>
>> I am looking for a way to use `np.PyArray_MultiIterNew2` in Cython to
>> broadcast parameters of a function. The requirement is that the two
>> arguments can be scalar and/or sequences. Using the usual
>> `n
On Sun, 2021-01-10 at 09:59 -0700, zoj613 wrote:
> Hi all,
>
> I am looking for a way to use `np.PyArray_MultiIterNew2` in Cython to
> broadcast parameters of a function. The requirement is that the two
> arguments can be scalar and/or sequences. Using the usual
> `np.broadcast`
> function works w
Hi all,
I am looking for a way to use `np.PyArray_MultiIterNew2` in Cython to
broadcast parameters of a function. The requirement is that the two
arguments can be scalar and/or sequences. Using the usual `np.broadcast`
function works well but is slow when iterating over the broadcasted input in
a