Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
18731a6a
提交
18731a6a
authored
6月 09, 2014
作者:
Tanjay94
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modified numpy test to reduced its length.
上级
11a6b95f
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
17 行增加
和
151 行删除
+17
-151
test_linalg.py
theano/sandbox/linalg/tests/test_linalg.py
+17
-151
没有找到文件。
theano/sandbox/linalg/tests/test_linalg.py
浏览文件 @
18731a6a
...
@@ -660,165 +660,31 @@ class T_NormTests(unittest.TestCase):
...
@@ -660,165 +660,31 @@ class T_NormTests(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
norm
,
[[
2
,
1
],
[
3
,
4
]],
None
,
3
)
self
.
assertRaises
(
ValueError
,
norm
,
[[
2
,
1
],
[
3
,
4
]],
None
,
3
)
def
test_numpy_compare
(
self
):
def
test_numpy_compare
(
self
):
f
=
[]
t_n
=
[]
n_n
=
[]
try
:
try
:
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
M
=
tensor
.
matrix
(
"A"
,
dtype
=
theano
.
config
.
floatX
)
M
=
tensor
.
matrix
(
"A"
,
dtype
=
theano
.
config
.
floatX
)
N
=
tensor
.
vector
(
"N"
,
dtype
=
theano
.
config
.
floatX
)
V
=
tensor
.
vector
(
"V"
,
dtype
=
theano
.
config
.
floatX
)
B
=
tensor
.
tensor3
(
"B"
,
dtype
=
theano
.
config
.
floatX
)
N
=
tensor
.
tensor3
(
"N"
,
dtype
=
theano
.
config
.
floatX
)
Q
=
norm
(
M
,
None
,
None
)
W
=
norm
(
M
,
'fro'
,
None
)
E
=
norm
(
M
,
'inf'
,
None
)
R
=
norm
(
M
,
'-inf'
,
None
)
T
=
norm
(
M
,
1
,
None
)
Y
=
norm
(
M
,
-
1
,
None
)
U
=
norm
(
N
,
None
,
None
)
I
=
norm
(
N
,
'inf'
,
None
)
O
=
norm
(
N
,
'-inf'
,
None
)
P
=
norm
(
N
,
0
,
None
)
L
=
norm
(
N
,
1
,
None
)
K
=
norm
(
N
,
-
1
,
None
)
J
=
norm
(
N
,
2
,
None
)
H
=
norm
(
N
,
-
2
,
None
)
QQ
=
norm
(
B
,
None
,
[
0
,
1
])
WW
=
norm
(
B
,
'fro'
,
[
0
,
1
])
EE
=
norm
(
B
,
'inf'
,
[
0
,
1
])
RR
=
norm
(
B
,
'-inf'
,
[
0
,
1
])
TT
=
norm
(
B
,
1
,
[
0
,
1
])
YY
=
norm
(
B
,
-
1
,
[
0
,
1
])
UU
=
norm
(
B
,
None
,
0
)
II
=
norm
(
B
,
'inf'
,
0
)
OO
=
norm
(
B
,
'-inf'
,
0
)
PP
=
norm
(
B
,
0
,
0
)
LL
=
norm
(
B
,
1
,
0
)
KK
=
norm
(
B
,
-
1
,
0
)
JJ
=
norm
(
B
,
2
,
0
)
HH
=
norm
(
B
,
-
2
,
0
)
fQ
=
function
([
M
],
[
Q
])
fW
=
function
([
M
],
[
W
])
fE
=
function
([
M
],
[
E
])
fR
=
function
([
M
],
[
R
])
fT
=
function
([
M
],
[
T
])
fY
=
function
([
M
],
[
Y
])
fU
=
function
([
N
],
[
U
])
fI
=
function
([
N
],
[
I
])
fO
=
function
([
N
],
[
O
])
fP
=
function
([
N
],
[
P
])
fL
=
function
([
N
],
[
L
])
fK
=
function
([
N
],
[
K
])
fJ
=
function
([
N
],
[
J
])
fH
=
function
([
N
],
[
H
])
fQQ
=
function
([
B
],
[
QQ
])
fWW
=
function
([
B
],
[
WW
])
fEE
=
function
([
B
],
[
EE
])
fRR
=
function
([
B
],
[
RR
])
fTT
=
function
([
B
],
[
TT
])
fYY
=
function
([
B
],
[
YY
])
fUU
=
function
([
B
],
[
UU
])
fII
=
function
([
B
],
[
II
])
fOO
=
function
([
B
],
[
OO
])
fPP
=
function
([
B
],
[
PP
])
fLL
=
function
([
B
],
[
LL
])
fKK
=
function
([
B
],
[
KK
])
fJJ
=
function
([
B
],
[
JJ
])
fHH
=
function
([
B
],
[
HH
])
a
=
rng
.
rand
(
4
,
4
)
.
astype
(
theano
.
config
.
floatX
)
a
=
rng
.
rand
(
4
,
4
)
.
astype
(
theano
.
config
.
floatX
)
b
=
rng
.
rand
(
4
)
.
astype
(
theano
.
config
.
floatX
)
b
=
rng
.
rand
(
4
)
.
astype
(
theano
.
config
.
floatX
)
c
=
rng
.
rand
(
4
,
4
,
4
)
.
astype
(
theano
.
config
.
floatX
)
c
=
rng
.
rand
(
4
,
4
,
4
)
.
astype
(
theano
.
config
.
floatX
)
n_nQ
=
numpy
.
linalg
.
norm
(
a
,
None
,
None
)
A
=
[
None
,
'fro'
,
'inf'
,
'-inf'
,
1
,
-
1
,
None
,
'inf'
,
'-inf'
,
0
,
1
,
-
1
,
2
,
-
2
,
None
,
'fro'
,
'inf'
,
'-inf'
,
1
,
-
1
,
None
,
'inf'
,
'-inf'
,
0
,
1
,
-
1
,
2
,
-
2
]
n_nW
=
numpy
.
linalg
.
norm
(
a
,
'fro'
,
None
)
B
=
[
M
,
M
,
M
,
M
,
M
,
M
,
V
,
V
,
V
,
V
,
V
,
V
,
V
,
V
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
N
]
n_nE
=
numpy
.
linalg
.
norm
(
a
,
inf
,
None
)
C
=
[
None
,
None
,
None
,
None
,
None
,
None
,
None
,
None
,
None
,
None
,
None
,
None
,
None
,
None
,
[
0
,
1
],
[
0
,
1
],
[
0
,
1
],
[
0
,
1
],
[
0
,
1
],
[
0
,
1
],
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]
n_nR
=
numpy
.
linalg
.
norm
(
a
,
-
inf
,
None
)
D
=
[
a
,
a
,
a
,
a
,
a
,
a
,
b
,
b
,
b
,
b
,
b
,
b
,
b
,
b
,
c
,
c
,
c
,
c
,
c
,
c
,
c
,
c
,
c
,
c
,
c
,
c
,
c
,
c
]
n_nT
=
numpy
.
linalg
.
norm
(
a
,
1
,
None
)
E
=
[
None
,
'fro'
,
inf
,
-
inf
,
1
,
-
1
,
None
,
inf
,
-
inf
,
0
,
1
,
-
1
,
2
,
-
2
,
None
,
'fro'
,
inf
,
-
inf
,
1
,
-
1
,
None
,
inf
,
-
inf
,
0
,
1
,
-
1
,
2
,
-
2
]
n_nY
=
numpy
.
linalg
.
norm
(
a
,
-
1
,
None
)
n_nU
=
numpy
.
linalg
.
norm
(
b
,
None
,
None
)
for
i
in
range
(
0
,
28
):
n_nI
=
numpy
.
linalg
.
norm
(
b
,
inf
,
None
)
f
.
append
(
function
([
B
[
i
]],
[
norm
(
B
[
i
],
A
[
i
],
C
[
i
])]))
n_nO
=
numpy
.
linalg
.
norm
(
b
,
-
inf
,
None
)
t_n
.
append
(
f
[
i
](
D
[
i
]))
n_nP
=
numpy
.
linalg
.
norm
(
b
,
0
,
None
)
n_n
.
append
(
numpy
.
linalg
.
norm
(
D
[
i
],
E
[
i
],
C
[
i
]))
n_nL
=
numpy
.
linalg
.
norm
(
b
,
1
,
None
)
assert
_allclose
(
n_n
[
i
],
t_n
[
i
])
n_nK
=
numpy
.
linalg
.
norm
(
b
,
-
1
,
None
)
n_nJ
=
numpy
.
linalg
.
norm
(
b
,
2
,
None
)
n_nH
=
numpy
.
linalg
.
norm
(
b
,
-
2
,
None
)
n_nQQ
=
numpy
.
linalg
.
norm
(
c
,
None
,
[
0
,
1
])
n_nWW
=
numpy
.
linalg
.
norm
(
c
,
'fro'
,
[
0
,
1
])
n_nEE
=
numpy
.
linalg
.
norm
(
c
,
inf
,
[
0
,
1
])
n_nRR
=
numpy
.
linalg
.
norm
(
c
,
-
inf
,
[
0
,
1
])
n_nTT
=
numpy
.
linalg
.
norm
(
c
,
1
,
[
0
,
1
])
n_nYY
=
numpy
.
linalg
.
norm
(
c
,
-
1
,
[
0
,
1
])
n_nUU
=
numpy
.
linalg
.
norm
(
c
,
None
,
0
)
n_nII
=
numpy
.
linalg
.
norm
(
c
,
inf
,
0
)
n_nOO
=
numpy
.
linalg
.
norm
(
c
,
-
inf
,
0
)
n_nPP
=
numpy
.
linalg
.
norm
(
c
,
0
,
0
)
n_nLL
=
numpy
.
linalg
.
norm
(
c
,
1
,
0
)
n_nKK
=
numpy
.
linalg
.
norm
(
c
,
-
1
,
0
)
n_nJJ
=
numpy
.
linalg
.
norm
(
c
,
2
,
0
)
n_nHH
=
numpy
.
linalg
.
norm
(
c
,
-
2
,
0
)
t_nQ
=
fQ
(
a
)
t_nW
=
fW
(
a
)
t_nE
=
fE
(
a
)
t_nR
=
fR
(
a
)
t_nT
=
fT
(
a
)
t_nY
=
fY
(
a
)
t_nU
=
fU
(
b
)
t_nI
=
fI
(
b
)
t_nO
=
fO
(
b
)
t_nP
=
fP
(
b
)
t_nL
=
fL
(
b
)
t_nK
=
fK
(
b
)
t_nJ
=
fJ
(
b
)
t_nH
=
fH
(
b
)
t_nQQ
=
fQ
(
c
)
t_nWW
=
fW
(
c
)
t_nEE
=
fE
(
c
)
t_nRR
=
fR
(
c
)
t_nTT
=
fT
(
c
)
t_nYY
=
fY
(
c
)
t_nUU
=
fU
(
c
)
t_nII
=
fI
(
c
)
t_nOO
=
fO
(
c
)
t_nPP
=
fP
(
c
)
t_nLL
=
fL
(
c
)
t_nKK
=
fK
(
c
)
t_nJJ
=
fJ
(
c
)
t_nHH
=
fH
(
c
)
assert
_allclose
(
n_nQ
,
t_nQ
)
assert
_allclose
(
n_nW
,
t_nW
)
assert
_allclose
(
n_nE
,
t_nE
)
assert
_allclose
(
n_nR
,
t_nR
)
assert
_allclose
(
n_nT
,
t_nT
)
assert
_allclose
(
n_nY
,
t_nY
)
assert
_allclose
(
n_nU
,
t_nU
)
assert
_allclose
(
n_nI
,
t_nI
)
assert
_allclose
(
n_nO
,
t_nO
)
assert
_allclose
(
n_nP
,
t_nP
)
assert
_allclose
(
n_nL
,
t_nL
)
assert
_allclose
(
n_nK
,
t_nK
)
assert
_allclose
(
n_nJ
,
t_nJ
)
assert
_allclose
(
n_nH
,
t_nH
)
assert
_allclose
(
n_nQQ
,
t_nQQ
)
assert
_allclose
(
n_nWW
,
t_nWW
)
assert
_allclose
(
n_nEE
,
t_nEE
)
assert
_allclose
(
n_nRR
,
t_nRR
)
assert
_allclose
(
n_nTT
,
t_nTT
)
assert
_allclose
(
n_nYY
,
t_nYY
)
assert
_allclose
(
n_nUU
,
t_nUU
)
assert
_allclose
(
n_nII
,
t_nII
)
assert
_allclose
(
n_nOO
,
t_nOO
)
assert
_allclose
(
n_nPP
,
t_nPP
)
assert
_allclose
(
n_nLL
,
t_nLL
)
assert
_allclose
(
n_nKK
,
t_nKK
)
assert
_allclose
(
n_nJJ
,
t_nJJ
)
assert
_allclose
(
n_nHH
,
t_nHH
)
except
TypeError
:
except
TypeError
:
raise
SkipTest
(
'Your numpy version is outdated.'
)
raise
SkipTest
(
'Your numpy version is outdated.'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论