提交 fca1603a authored 作者: Frederic's avatar Frederic

Another speed up for rng state init.

上级 322d46a2
...@@ -9,7 +9,7 @@ import warnings ...@@ -9,7 +9,7 @@ import warnings
import numpy import numpy
from theano import Op, Apply, shared, config, Variable from theano import Op, Apply, shared, config, Variable, Out
from theano import gradient, function from theano import gradient, function
from theano import tensor from theano import tensor
from theano.tensor import (raw_random, TensorType, as_tensor_variable, from theano.tensor import (raw_random, TensorType, as_tensor_variable,
...@@ -44,9 +44,9 @@ def multMatVect(v, A, m1, B, m2): ...@@ -44,9 +44,9 @@ def multMatVect(v, A, m1, B, m2):
A_sym = tensor.lmatrix('A') A_sym = tensor.lmatrix('A')
s_sym = tensor.ivector('s') s_sym = tensor.ivector('s')
m_sym = tensor.iscalar('m') m_sym = tensor.iscalar('m')
# We borrow the output as we will copy the answer elsewhere
multMatVect.dot_modulo = function([A_sym, s_sym, m_sym], o = Out(DotModulo()(A_sym, s_sym, m_sym), borrow=True)
DotModulo()(A_sym, s_sym, m_sym)) multMatVect.dot_modulo = function([A_sym, s_sym, m_sym], o)
r = numpy.zeros_like(v) r = numpy.zeros_like(v)
# This way of calling the Theano fct is done to bypass Theano overhead. # This way of calling the Theano fct is done to bypass Theano overhead.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论