Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4fe8381e
提交
4fe8381e
authored
7月 30, 2012
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #792 from nouiz/fix_py2.4
small Fix py2.4
上级
ef1b9f3a
ed81fdd7
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
32 行增加
和
22 行删除
+32
-22
pycuda_init.py
theano/misc/pycuda_init.py
+20
-14
fourier.py
theano/tensor/fourier.py
+2
-2
Conv3D.py
theano/tensor/nnet/Conv3D.py
+1
-1
ConvGrad3D.py
theano/tensor/nnet/ConvGrad3D.py
+1
-1
ConvTransp3D.py
theano/tensor/nnet/ConvTransp3D.py
+1
-1
test_conv3d.py
theano/tensor/nnet/tests/test_conv3d.py
+2
-2
test_nnet.py
theano/tensor/nnet/tests/test_nnet.py
+1
-1
test_basic.py
theano/tensor/tests/test_basic.py
+2
-0
test_elemwise.py
theano/tensor/tests/test_elemwise.py
+1
-0
test_ifelse.py
theano/tests/test_ifelse.py
+1
-0
没有找到文件。
theano/misc/pycuda_init.py
浏览文件 @
4fe8381e
...
...
@@ -41,17 +41,23 @@ if (not hasattr(theano.sandbox, 'cuda') or
import
pycuda.autoinit
pycuda_available
=
True
else
:
import
pycuda.driver
if
hasattr
(
pycuda
.
driver
.
Context
,
"attach"
):
pycuda
.
driver
.
Context
.
attach
()
else
:
# Now we always import this file when we call theano.sandbox.cuda.use
# So this should not happen normally.
# TODO: make this an error.
warnings
.
warn
(
"For some unknow reason, theano.misc.pycuda_init was not"
" imported before Theano initialized the GPU and"
" your PyCUDA version is 2011.2.2 or earlier."
" To fix the problem, import theano.misc.pycuda_init"
" manually before using/initializing the GPU, use the"
" Theano flag pycuda.init=True or use a"
" more recent version of PyCUDA."
)
try
:
import
pycuda.driver
pycuda_available
=
True
except
ImportError
:
pass
if
pycuda_available
:
if
hasattr
(
pycuda
.
driver
.
Context
,
"attach"
):
pycuda
.
driver
.
Context
.
attach
()
else
:
# Now we always import this file when we call
# theano.sandbox.cuda.use. So this should not happen
# normally.
# TODO: make this an error.
warnings
.
warn
(
"For some unknow reason, theano.misc.pycuda_init was"
" not imported before Theano initialized the GPU and"
" your PyCUDA version is 2011.2.2 or earlier."
" To fix the problem, import theano.misc.pycuda_init"
" manually before using/initializing the GPU, use the"
" Theano flag pycuda.init=True or use a"
" more recent version of PyCUDA."
)
theano/tensor/fourier.py
浏览文件 @
4fe8381e
...
...
@@ -89,7 +89,7 @@ class Fourier(gof.Op):
if
len
(
shape_a
)
==
1
:
return
[(
n
,)]
elif
isinstance
(
axis
,
tensor
.
TensorConstant
):
out_shape
=
list
(
shape_a
[
0
:
axis
.
data
])
+
[
n
]
+
\
out_shape
=
list
(
shape_a
[
0
:
axis
.
data
.
item
()
])
+
[
n
]
+
\
list
(
shape_a
[
axis
.
data
+
1
:])
else
:
l
=
len
(
shape_a
)
...
...
@@ -105,7 +105,7 @@ class Fourier(gof.Op):
a
=
inputs
[
0
]
n
=
inputs
[
1
]
axis
=
inputs
[
2
]
output_storage
[
0
][
0
]
=
numpy
.
fft
.
fft
(
a
,
n
=
int
(
n
),
axis
=
axis
)
output_storage
[
0
][
0
]
=
numpy
.
fft
.
fft
(
a
,
n
=
int
(
n
),
axis
=
axis
.
item
()
)
def
grad
(
self
,
inputs
,
cost_grad
):
"""
...
...
theano/tensor/nnet/Conv3D.py
浏览文件 @
4fe8381e
...
...
@@ -121,7 +121,7 @@ class Conv3D(theano.Op):
def
perform
(
self
,
node
,
inputs
,
output_storage
):
V
,
W
,
b
,
d
=
inputs
print
"Conv3D python code"
#
print "Conv3D python code"
output_storage
[
0
][
0
]
=
computeH
(
V
,
W
,
b
,
d
)
def
infer_shape
(
self
,
node
,
input_shapes
):
...
...
theano/tensor/nnet/ConvGrad3D.py
浏览文件 @
4fe8381e
...
...
@@ -44,7 +44,7 @@ class ConvGrad3D(theano.Op):
def
perform
(
self
,
node
,
inputs
,
output_storage
):
V
,
d
,
WShape
,
dCdH
=
inputs
print
"ConvGradW3D python code"
#
print "ConvGradW3D python code"
#partial C / partial W[j,z,k,l,m] = sum_i sum_p sum_q sum_r (partial C /partial H[i,j,p,q,r] ) * V[i,z,dr*p+k,dc*q+l,dt*r+m]
...
...
theano/tensor/nnet/ConvTransp3D.py
浏览文件 @
4fe8381e
...
...
@@ -83,7 +83,7 @@ class ConvTransp3D(theano.Op):
def
perform
(
self
,
node
,
inputs
,
output_storage
):
W
,
b
,
d
,
H
,
RShape
=
inputs
print
"
\t\t\t\t
ConvTransp3D python code"
#
print "\t\t\t\tConvTransp3D python code"
output_storage
[
0
][
0
]
=
computeR
(
W
,
b
,
d
,
H
,
RShape
)
def
c_code
(
self
,
node
,
nodename
,
inputs
,
outputs
,
sub
):
...
...
theano/tensor/nnet/tests/test_conv3d.py
浏览文件 @
4fe8381e
...
...
@@ -97,8 +97,8 @@ class DummyConvTransp3D:
self
.
dW
=
rng
.
uniform
(
-
1
,
1
,
self
.
W
.
get_value
(
borrow
=
True
)
.
shape
)
self
.
db
=
rng
.
uniform
(
-
1
,
1
,
self
.
b
.
get_value
(
borrow
=
True
)
.
shape
)
self
.
dH
=
rng
.
uniform
(
-
1
,
1
,
self
.
H
.
get_value
(
borrow
=
True
)
.
shape
)
self
.
dW
,
self
.
db
,
self
.
dH
=
shared
(
self
.
dW
),
shared
(
self
.
db
),
shared
(
self
.
dH
)
self
.
dW
,
self
.
db
=
shared
(
self
.
dW
),
shared
(
self
.
db
),
s
elf
.
dH
=
s
hared
(
self
.
dH
)
self
.
d
=
d
self
.
RShape
=
RShape
...
...
theano/tensor/nnet/tests/test_nnet.py
浏览文件 @
4fe8381e
...
...
@@ -276,7 +276,7 @@ class T_prepend(utt.InferShapeTester):
def
test0
(
self
):
x
=
tensor
.
matrix
(
'x'
)
y
=
Prepend_scalar_constant_to_each_row
(
4.
)(
x
)
f
=
theano
.
function
([
x
],
[
y
]
)
f
=
theano
.
function
([
x
],
y
)
m
=
numpy
.
random
.
rand
(
3
,
5
)
my
=
f
(
m
)
self
.
assertTrue
(
my
.
shape
==
(
3
,
6
),
my
.
shape
)
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
4fe8381e
...
...
@@ -1245,6 +1245,8 @@ if imported_scipy_special:
else
:
expected_erf
=
[]
expected_erfc
=
[]
expected_gammaln
=
[]
expected_psi
=
[]
skip_scipy
=
"scipy is not present"
ErfTester
=
makeBroadcastTester
(
...
...
theano/tensor/tests/test_elemwise.py
浏览文件 @
4fe8381e
...
...
@@ -8,6 +8,7 @@ import numpy
from
numpy.testing
import
dec
import
theano
from
theano.gof.python25
import
all
from
theano.gof
import
Variable
,
Op
from
theano
import
gof
,
scalar
,
config
...
...
theano/tests/test_ifelse.py
浏览文件 @
4fe8381e
...
...
@@ -16,6 +16,7 @@ from theano import tensor
import
theano.ifelse
from
theano.ifelse
import
IfElse
,
ifelse
from
theano.tests
import
unittest_tools
as
utt
from
theano.gof.python25
import
all
class
test_ifelse
(
unittest
.
TestCase
,
utt
.
TestOptimizationMixin
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论