Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
eab9cf5d
提交
eab9cf5d
authored
2月 19, 2016
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4092 from abergeron/fix_buildbot2
New problems cropped up on the buildbot
上级
a08fc0c1
7618e106
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
19 行增加
和
6 行删除
+19
-6
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+5
-1
test_blas.py
theano/sandbox/cuda/tests/test_blas.py
+2
-2
scan_opt.py
theano/scan_module/scan_opt.py
+1
-1
test_basic.py
theano/sparse/tests/test_basic.py
+11
-2
没有找到文件。
theano/sandbox/cuda/basic_ops.py
浏览文件 @
eab9cf5d
...
@@ -3684,7 +3684,7 @@ class GpuAllocEmpty(GpuOp):
...
@@ -3684,7 +3684,7 @@ class GpuAllocEmpty(GpuOp):
return
Apply
(
self
,
shape
,
[
output
])
return
Apply
(
self
,
shape
,
[
output
])
def
debug_perform
(
self
,
node
,
inputs
,
out_
):
def
debug_perform
(
self
,
node
,
inputs
,
out_
):
self
.
perform
(
self
,
node
,
inputs
,
out_
)
self
.
perform
(
node
,
inputs
,
out_
)
# __setitem__ is limited on CudaNdarray
# __setitem__ is limited on CudaNdarray
tmp
=
numpy
.
empty
(
out_
[
0
][
0
]
.
shape
,
dtype
=
'float32'
)
tmp
=
numpy
.
empty
(
out_
[
0
][
0
]
.
shape
,
dtype
=
'float32'
)
tmp
.
fill
(
-
123456789
)
tmp
.
fill
(
-
123456789
)
...
@@ -3769,6 +3769,10 @@ class GpuAlloc(GpuAllocEmpty):
...
@@ -3769,6 +3769,10 @@ class GpuAlloc(GpuAllocEmpty):
shape
,
output
=
self
.
validate_shape
(
shape
)
shape
,
output
=
self
.
validate_shape
(
shape
)
return
Apply
(
self
,
[
v
]
+
shape
,
[
output
])
return
Apply
(
self
,
[
v
]
+
shape
,
[
output
])
# This is required because the superclass (GpuAllocEmpty) also has it.
def
debug_perform
(
self
,
node
,
inputs
,
out_
):
self
.
perform
(
node
,
inputs
,
out_
)
def
perform
(
self
,
node
,
inputs
,
out_
):
def
perform
(
self
,
node
,
inputs
,
out_
):
# the super class (GpuAllocEmpty) allocates memory, we fill it
# the super class (GpuAllocEmpty) allocates memory, we fill it
value
=
inputs
[
0
]
value
=
inputs
[
0
]
...
...
theano/sandbox/cuda/tests/test_blas.py
浏览文件 @
eab9cf5d
...
@@ -17,7 +17,7 @@ if cuda_ndarray.cuda_available == False:
...
@@ -17,7 +17,7 @@ if cuda_ndarray.cuda_available == False:
import
theano.sandbox.cuda
as
tcn
import
theano.sandbox.cuda
as
tcn
from
theano.tensor.signal.pool
import
(
Pool
,
from
theano.tensor.signal.pool
import
(
Pool
,
DownsampleFactorMax
Grad
,
DownsampleFactorMaxGradGrad
)
Pool
Grad
,
DownsampleFactorMaxGradGrad
)
import
theano.compile.mode
import
theano.compile.mode
from
theano.tensor.tests.test_blas
import
BaseGemv
,
TestBlasStrides
,
TestGer
from
theano.tensor.tests.test_blas
import
BaseGemv
,
TestBlasStrides
,
TestGer
...
@@ -394,7 +394,7 @@ def test_downsample():
...
@@ -394,7 +394,7 @@ def test_downsample():
assert
any
([
isinstance
(
node
.
op
,
assert
any
([
isinstance
(
node
.
op
,
tcn
.
blas
.
GpuDownsampleFactorMaxGrad
)
tcn
.
blas
.
GpuDownsampleFactorMaxGrad
)
for
node
in
g
.
maker
.
fgraph
.
toposort
()])
for
node
in
g
.
maker
.
fgraph
.
toposort
()])
assert
any
([
isinstance
(
node
.
op
,
DownsampleFactorMax
Grad
)
assert
any
([
isinstance
(
node
.
op
,
Pool
Grad
)
for
node
in
g2
.
maker
.
fgraph
.
toposort
()])
for
node
in
g2
.
maker
.
fgraph
.
toposort
()])
assert
numpy
.
allclose
(
g
(),
g2
()),
shp
assert
numpy
.
allclose
(
g
(),
g2
()),
shp
...
...
theano/scan_module/scan_opt.py
浏览文件 @
eab9cf5d
...
@@ -926,7 +926,7 @@ class PushOutScanOutput(gof.Optimizer):
...
@@ -926,7 +926,7 @@ class PushOutScanOutput(gof.Optimizer):
# For the inner_vars that don't already exist in the outer graph, add
# For the inner_vars that don't already exist in the outer graph, add
# them as new nitsot outputs to the scan node.
# them as new nitsot outputs to the scan node.
idx_add_as_nitsots
=
[
i
for
i
in
range
(
len
(
outer_vars
))
idx_add_as_nitsots
=
[
i
for
i
in
range
(
len
(
outer_vars
))
if
outer_vars
[
i
]
==
None
]
if
outer_vars
[
i
]
is
None
]
add_as_nitsots
=
[
inner_vars
[
idx
]
for
idx
in
idx_add_as_nitsots
]
add_as_nitsots
=
[
inner_vars
[
idx
]
for
idx
in
idx_add_as_nitsots
]
if
len
(
add_as_nitsots
)
>
0
:
if
len
(
add_as_nitsots
)
>
0
:
...
...
theano/sparse/tests/test_basic.py
浏览文件 @
eab9cf5d
...
@@ -67,6 +67,15 @@ def eval_outputs(outputs):
...
@@ -67,6 +67,15 @@ def eval_outputs(outputs):
return
compile
.
function
([],
outputs
)()[
0
]
return
compile
.
function
([],
outputs
)()[
0
]
# scipy 0.17 will return sparse values in all cases while previous
# version sometimes wouldn't. This will make everything dense so that
# we can use assert_allclose.
def
as_ndarray
(
val
):
if
hasattr
(
val
,
'toarray'
):
return
val
.
toarray
()
return
val
def
random_lil
(
shape
,
dtype
,
nnz
):
def
random_lil
(
shape
,
dtype
,
nnz
):
rval
=
sp
.
lil_matrix
(
shape
,
dtype
=
dtype
)
rval
=
sp
.
lil_matrix
(
shape
,
dtype
=
dtype
)
huge
=
2
**
30
huge
=
2
**
30
...
@@ -2956,7 +2965,7 @@ class StructuredAddSVTester(unittest.TestCase):
...
@@ -2956,7 +2965,7 @@ class StructuredAddSVTester(unittest.TestCase):
out
=
f
(
spmat
,
mat
)
out
=
f
(
spmat
,
mat
)
utt
.
assert_allclose
(
spones
.
multiply
(
spmat
+
mat
),
utt
.
assert_allclose
(
as_ndarray
(
spones
.
multiply
(
spmat
+
mat
)
),
out
.
toarray
())
out
.
toarray
())
...
@@ -3072,7 +3081,7 @@ class SamplingDotTester(utt.InferShapeTester):
...
@@ -3072,7 +3081,7 @@ class SamplingDotTester(utt.InferShapeTester):
x
,
y
,
p
=
self
.
a
x
,
y
,
p
=
self
.
a
expected
=
p
.
multiply
(
numpy
.
dot
(
x
,
y
.
T
))
expected
=
p
.
multiply
(
numpy
.
dot
(
x
,
y
.
T
))
utt
.
assert_allclose
(
expected
,
tested
.
toarray
())
utt
.
assert_allclose
(
as_ndarray
(
expected
)
,
tested
.
toarray
())
assert
tested
.
format
==
'csr'
assert
tested
.
format
==
'csr'
assert
tested
.
dtype
==
expected
.
dtype
assert
tested
.
dtype
==
expected
.
dtype
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论