예제 #1
0
    raise NotImplementedError


def array_equal(a1, a2):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def array_equiv(a1, a2):
    # TODO(beam2d): Implement it
    raise NotImplementedError


greater = ufunc.create_comparison(
    'greater', '>', '''Tests elementwise if ``x1 > x2``.

    .. seealso:: :data:`numpy.greater`

    ''')

greater_equal = ufunc.create_comparison(
    'greater_equal', '>=', '''Tests elementwise if ``x1 >= x2``.

    .. seealso:: :data:`numpy.greater_equal`

    ''')

less = ufunc.create_comparison(
    'less', '<', '''Tests elementwise if ``x1 < x2``.

    .. seealso:: :data:`numpy.less`
예제 #2
0
from cupy import elementwise
from cupy.logic import ufunc

logical_and = ufunc.create_comparison(
    'logical_and', '&&', '''Computes the logical AND of two arrays.

    .. seealso:: :data:`numpy.logical_and`

    ''')

logical_or = ufunc.create_comparison(
    'logical_or', '||', '''Computes the logical OR of two arrays.

    .. seealso:: :data:`numpy.logical_or`

    ''')

logical_not = elementwise.create_ufunc(
    'cupy_logical_not',
    ('?->?', 'b->?', 'B->?', 'h->?', 'H->?', 'i->?', 'I->?', 'l->?', 'L->?',
     'q->?', 'Q->?', 'e->?', 'f->?', 'd->?'),
    'out0 = !in0',
    doc='''Computes the logical NOT of an array.

    .. seealso:: :data:`numpy.logical_not`

    ''')

logical_xor = elementwise.create_ufunc(
    'cupy_logical_xor',
    ('??->?', 'bb->?', 'BB->?', 'hh->?', 'HH->?', 'ii->?', 'II->?', 'll->?',
예제 #3
0

# TODO(okuta): Implement isclose


# TODO(okuta): Implement array_equal


# TODO(okuta): Implement array_equiv


greater = ufunc.create_comparison(
    "greater",
    ">",
    """Tests elementwise if ``x1 > x2``.

    .. seealso:: :data:`numpy.greater`

    """,
)


greater_equal = ufunc.create_comparison(
    "greater_equal",
    ">=",
    """Tests elementwise if ``x1 >= x2``.

    .. seealso:: :data:`numpy.greater_equal`

    """,
)
예제 #4
0

def array_equal(a1, a2):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def array_equiv(a1, a2):
    # TODO(beam2d): Implement it
    raise NotImplementedError


greater = ufunc.create_comparison(
    'greater', '>',
    '''Tests elementwise if ``x1 > x2``.

    .. seealso:: :data:`numpy.greater`

    ''')


greater_equal = ufunc.create_comparison(
    'greater_equal', '>=',
    '''Tests elementwise if ``x1 >= x2``.

    .. seealso:: :data:`numpy.greater_equal`

    ''')


less = ufunc.create_comparison(
예제 #5
0
from cupy import elementwise
from cupy.logic import ufunc

logical_and = ufunc.create_comparison(
    'logical_and', '&&',
    '''Computes the logical AND of two arrays.

    .. seealso:: :data:`numpy.logical_and`

    ''')


logical_or = ufunc.create_comparison(
    'logical_or', '||',
    '''Computes the logical OR of two arrays.

    .. seealso:: :data:`numpy.logical_or`

    ''')


logical_not = elementwise.create_ufunc(
    'cupy_logical_not',
    ('?->?', 'b->?', 'B->?', 'h->?', 'H->?', 'i->?', 'I->?', 'l->?', 'L->?',
     'q->?', 'Q->?', 'e->?', 'f->?', 'd->?'),
    'out0 = !in0',
    doc='''Computes the logical NOT of an array.

    .. seealso:: :data:`numpy.logical_not`

    ''')