Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b57f6c25
提交
b57f6c25
authored
11月 16, 2010
作者:
Josh Bleecher Snyder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change ambiguous tabs (caught by tabnanny) to spaces.
上级
979a35e7
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
18 行删除
+18
-18
gen_oplist.py
doc/scripts/gen_oplist.py
+2
-2
test_cuda_ndarray.py
theano/sandbox/cuda/tests/test_cuda_ndarray.py
+15
-15
test_scan.py
theano/tests/test_scan.py
+1
-1
没有找到文件。
doc/scripts/gen_oplist.py
浏览文件 @
b57f6c25
...
@@ -107,8 +107,8 @@ def search_entries(module_list, ops = None, constructors = None, seen = None):
...
@@ -107,8 +107,8 @@ def search_entries(module_list, ops = None, constructors = None, seen = None):
for
module
in
module_list
:
for
module
in
module_list
:
symbol_name_list
=
[
s
for
s
in
dir
(
module
)
if
not
s
[
0
]
==
'_'
]
symbol_name_list
=
[
s
for
s
in
dir
(
module
)
if
not
s
[
0
]
==
'_'
]
for
symbol_name
in
symbol_name_list
:
for
symbol_name
in
symbol_name_list
:
symbol
=
getattr
(
module
,
symbol_name
)
symbol
=
getattr
(
module
,
symbol_name
)
try
:
try
:
if
symbol
in
seen
:
if
symbol
in
seen
:
continue
continue
...
...
theano/sandbox/cuda/tests/test_cuda_ndarray.py
浏览文件 @
b57f6c25
...
@@ -44,7 +44,7 @@ def test_add():
...
@@ -44,7 +44,7 @@ def test_add():
print
shape
,
'adding '
,
a0
.
size
,
'cpu'
,
cpu_dt
,
'advantage'
,
cpu_dt
/
gpu_dt
print
shape
,
'adding '
,
a0
.
size
,
'cpu'
,
cpu_dt
,
'advantage'
,
cpu_dt
/
gpu_dt
assert
numpy
.
allclose
(
asum
,
numpy
.
asarray
(
bsum
))
assert
numpy
.
allclose
(
asum
,
numpy
.
asarray
(
bsum
))
if
len
(
shape
)
>
0
:
if
len
(
shape
)
>
0
:
#test inplace version, not implemented with 0 dims
#test inplace version, not implemented with 0 dims
b0
+=
b1
b0
+=
b1
a0
+=
a1
a0
+=
a1
...
@@ -299,20 +299,20 @@ def test_mapping_getitem_w_int():
...
@@ -299,20 +299,20 @@ def test_mapping_getitem_w_int():
def
_cmpf
(
x
,
*
y
):
def
_cmpf
(
x
,
*
y
):
try
:
try
:
x
.
__getitem__
(
y
)
x
.
__getitem__
(
y
)
except
IndexError
:
except
IndexError
:
pass
pass
else
:
else
:
raise
Exception
(
"Did not generate out or bound error"
)
raise
Exception
(
"Did not generate out or bound error"
)
def
_cmpfV
(
x
,
*
y
):
def
_cmpfV
(
x
,
*
y
):
try
:
try
:
if
len
(
y
)
==
1
:
if
len
(
y
)
==
1
:
x
.
__getitem__
(
*
y
)
x
.
__getitem__
(
*
y
)
else
:
else
:
x
.
__getitem__
(
y
)
x
.
__getitem__
(
y
)
except
ValueError
:
except
ValueError
:
pass
pass
else
:
else
:
raise
Exception
(
"Did not generate out or bound error"
)
raise
Exception
(
"Did not generate out or bound error"
)
dim
=
(
2
,)
dim
=
(
2
,)
...
@@ -421,7 +421,7 @@ def test_setitem_matrixvector1():
...
@@ -421,7 +421,7 @@ def test_setitem_matrixvector1():
try
:
try
:
_a
[:,
1
]
=
b
*
100
_a
[:,
1
]
=
b
*
100
a
[:,
1
]
=
b
*
100
a
[:,
1
]
=
b
*
100
raise
Exception
(
"CudaNdarray.__setitem__ should have returned an error"
)
raise
Exception
(
"CudaNdarray.__setitem__ should have returned an error"
)
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
_a
))
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
_a
))
except
NotImplementedError
,
e
:
except
NotImplementedError
,
e
:
pass
pass
...
@@ -450,7 +450,7 @@ def test_setitem_matrix_tensor3():
...
@@ -450,7 +450,7 @@ def test_setitem_matrix_tensor3():
try
:
try
:
_a
[:,
1
,
1
]
=
b
*
100
_a
[:,
1
,
1
]
=
b
*
100
a
[:,
1
,
1
]
=
b
*
100
a
[:,
1
,
1
]
=
b
*
100
raise
Exception
(
"CudaNdarray.__setitem__ should have returned an error"
)
raise
Exception
(
"CudaNdarray.__setitem__ should have returned an error"
)
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
_a
))
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
_a
))
except
NotImplementedError
:
except
NotImplementedError
:
pass
pass
...
@@ -605,7 +605,7 @@ def test_setitem_broadcast_numpy():
...
@@ -605,7 +605,7 @@ def test_setitem_broadcast_numpy():
try
:
try
:
_a
[:]
=
b
.
reshape
((
1
,))
_a
[:]
=
b
.
reshape
((
1
,))
a
[:]
=
b
.
reshape
((
1
,))
a
[:]
=
b
.
reshape
((
1
,))
assert
False
assert
False
assert
numpy
.
allclose
(
numpy
.
asarray
(
_a
),
a
)
assert
numpy
.
allclose
(
numpy
.
asarray
(
_a
),
a
)
except
ValueError
:
except
ValueError
:
pass
pass
...
@@ -619,10 +619,10 @@ def test_setitem_broadcast_numpy():
...
@@ -619,10 +619,10 @@ def test_setitem_broadcast_numpy():
b
=
theano
.
_asarray
([
7
,
8
,
9
],
dtype
=
'float32'
)
b
=
theano
.
_asarray
([
7
,
8
,
9
],
dtype
=
'float32'
)
_a
[:,:]
=
b
.
reshape
((
1
,
3
))
_a
[:,:]
=
b
.
reshape
((
1
,
3
))
a
[:,:]
=
b
.
reshape
((
1
,
3
))
a
[:,:]
=
b
.
reshape
((
1
,
3
))
assert
False
assert
False
assert
numpy
.
allclose
(
numpy
.
asarray
(
_a
),
a
)
assert
numpy
.
allclose
(
numpy
.
asarray
(
_a
),
a
)
except
ValueError
:
except
ValueError
:
pass
pass
#test vector to matrice with stride
#test vector to matrice with stride
a
=
numpy
.
arange
(
27
)
a
=
numpy
.
arange
(
27
)
...
@@ -635,10 +635,10 @@ def test_setitem_broadcast_numpy():
...
@@ -635,10 +635,10 @@ def test_setitem_broadcast_numpy():
b
=
b
[
0
]
b
=
b
[
0
]
_a
[
1
,:,:]
=
b
.
reshape
((
1
,
3
))
_a
[
1
,:,:]
=
b
.
reshape
((
1
,
3
))
a
[
1
,:,:]
=
b
.
reshape
((
1
,
3
))
a
[
1
,:,:]
=
b
.
reshape
((
1
,
3
))
assert
False
assert
False
assert
numpy
.
allclose
(
numpy
.
asarray
(
_a
),
a
)
assert
numpy
.
allclose
(
numpy
.
asarray
(
_a
),
a
)
except
ValueError
:
except
ValueError
:
pass
pass
# this also fails for the moment
# this also fails for the moment
def
test_setitem_rightvalue_ndarray_fails
():
def
test_setitem_rightvalue_ndarray_fails
():
...
...
theano/tests/test_scan.py
浏览文件 @
b57f6c25
...
@@ -77,7 +77,7 @@ class multiple_outputs_numeric_grad:
...
@@ -77,7 +77,7 @@ class multiple_outputs_numeric_grad:
for
i
in
xrange
(
len
(
pt
)):
for
i
in
xrange
(
len
(
pt
)):
if
ndarray_mask
[
i
]:
if
ndarray_mask
[
i
]:
# It is a ndarray that we can tweak
# It is a ndarray that we can tweak
if
eps
:
if
eps
:
_eps
=
eps
_eps
=
eps
else
:
else
:
_eps
=
dtype_eps
_eps
=
dtype_eps
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论