예제 #1
0
def test_logical_xor_out():
    a = D.array([True, False, False, True], dtype=D.bool)
    b = D.array([False, False, True, True], dtype=D.bool)
    ref = D.array([True, False, True, False], dtype=D.bool)
    out = D.zeros_like(a, dtype=D.bool)
    D.logical_xor(a, b, out=out)
    assert (D.all(out == ref))
예제 #2
0
def test_logical_not_out_where():
    a = D.array([True, False, False, True], dtype=D.bool)
    ref = D.array([False, False, False, False], dtype=D.bool)
    out = D.zeros_like(a, dtype=D.bool)
    where = D.array([True, False, False, True], dtype=D.bool)
    D.logical_not(a, out=out, where=where)
    assert (D.all(out[where] == ref[where]))