cupy.ufunc#

class cupy.ufunc(name, nin, nout, _Ops ops, preamble=u'', loop_prep=u'', doc=u'', default_casting=None, _Ops out_ops=None, *, cutensor_op=None, scatter_op=None)[source]#

Universal function.

Variables:
  • ~ufunc.name (str) – The name of the universal function.

  • ~ufunc.nin (int) – Number of input arguments.

  • ~ufunc.nout (int) – Number of output arguments.

  • ~ufunc.nargs (int) – Number of all arguments.

Methods

__call__()#

Applies the universal function to arguments elementwise.

Parameters:
  • args – Input arguments. Each of them can be a cupy.ndarray object or a scalar. The output arguments can be omitted or be specified by the out argument.

  • out (cupy.ndarray) – Output array. It outputs to new arrays default.

  • dtype – Data type specifier.

Returns:

Output array or a tuple of output arrays.

accumulate(self, array, axis=0, dtype=None, out=None)#

Accumulate array applying ufunc.

at(self, a, indices, b=None)#

Apply in place operation on the operand a for elements specified by indices.

See also

numpy.ufunc.at()

outer(self, A, B, **kwargs)#

Apply the ufunc operation to all pairs of elements in A and B.

reduce(self, array, axis=0, dtype=None, out=None, keepdims=False)#

Reduce array applying ufunc.

reduceat(self, array, indices, axis=0, dtype=None, out=None)#

Reduce array applying ufunc with indices.

__eq__(value, /)#

Return self==value.

__ne__(value, /)#

Return self!=value.

__lt__(value, /)#

Return self<value.

__le__(value, /)#

Return self<=value.

__gt__(value, /)#

Return self>value.

__ge__(value, /)#

Return self>=value.

Attributes

name#
nargs#
nin#
nout#
types#

A list of type signatures.

Each type signature is represented by type character codes of inputs and outputs separated by ‘->’.