提交 26cd1b81 authored 作者: Frederic Bastien's avatar Frederic Bastien

backport to python 2.4

上级 1e40fe89
...@@ -19,7 +19,10 @@ from theano.sandbox.cuda import cuda_enabled, CudaNdarrayType #, gpu_from_host, ...@@ -19,7 +19,10 @@ from theano.sandbox.cuda import cuda_enabled, CudaNdarrayType #, gpu_from_host,
def mulmod(a, b, c, m): def mulmod(a, b, c, m):
r = numpy.int32((numpy.int64(a)*b + c) % m) r = numpy.int32((numpy.int64(a)*b + c) % m)
return r if r >= 0 else r+m if r >= 0:
return r
else:
return r+m
def matVecModM(A, s, m): def matVecModM(A, s, m):
# return (A * s) % m # return (A * s) % m
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论