def test_cdata():
if not theano.config.cxx:
raise SkipTest("G++ not available, so we need to skip this test.")
i = TensorType('float32', (False,))()
c = ProdOp()(i)
i2 = GetOp()(c)
mode = None
if theano.config.mode == "FAST_COMPILE":
mode = "FAST_RUN"
# This should be a passthrough function for vectors
f = theano.function([i], i2, mode=mode)
v = numpy.random.randn(9).astype('float32')
v2 = f(v)
assert (v2 == v).all()
评论列表
文章目录