def test_and(self):
for dtype in self.dtype:
x, y = vector(dtype=dtype), vector(dtype=dtype)
fn = inplace_func([x, y], x & y)
l = theano._asarray([0, 0, 1, 1], dtype=dtype)
r = theano._asarray([0, 1, 0, 1], dtype=dtype)
v = fn(l, r)
self.assertTrue(numpy.all(v == (operator.and_(l, r))), (l, r, v))
评论列表
文章目录