def test_simple(self):
alpha, beta, a, x, y = [self.shared(value)
for value in self.get_data()]
desired_oy = alpha.get_value() * matrixmultiply(a.
get_value(), x.get_value()) + beta.get_value() * y.get_value()
oy = alpha * T.dot(a, x) + beta * y
oy_func = theano.function([], oy, mode=self.mode)
topo = oy_func.maker.fgraph.toposort()
self.assertFunctionContains1(oy_func, self.gemv)
oy_val = oy_func()
assert_array_almost_equal(desired_oy, oy_val)
评论列表
文章目录