python - Is there a `ufunc` that just forwards the data? -


is there ufunc forwards data?

it's not difficult achieve same effect in cases, when explicitly working ufuncs, convenient have 1 forwards data. testing/debugging , have consistently looking code.

for example, when have function takes ufunc argument:

op = ufunc x = do_with_op(data0, data1, op) 

if data real, np.conj(x), complex conjugate, identity unary ufunc.


you can create own ufuncs np.frompyfunc:

forward_unary  = np.frompyfunc(lambda x:    x, 1, 1) forward_first  = np.frompyfunc(lambda x, y: x, 2, 1) forward_second = np.frompyfunc(lambda x, y: y, 2, 1) 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -