Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e2ee93fc
提交
e2ee93fc
authored
7月 10, 2017
作者:
Pascal Lamblin
提交者:
GitHub
7月 10, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6060 from notoraptor/fix-magma-buildbot
(small fix) Increase error tolerance for magma matrix_inverse tests.
上级
fb3e9866
4baf9c1d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
10 行增加
和
7 行删除
+10
-7
test_linalg.py
theano/gpuarray/tests/test_linalg.py
+7
-4
unittest_tools.py
theano/tests/unittest_tools.py
+3
-3
没有找到文件。
theano/gpuarray/tests/test_linalg.py
浏览文件 @
e2ee93fc
...
@@ -212,18 +212,21 @@ class TestMagma(unittest.TestCase):
...
@@ -212,18 +212,21 @@ class TestMagma(unittest.TestCase):
fn
=
theano
.
function
([
A
],
gpu_matrix_inverse
(
A
),
mode
=
mode_with_gpu
)
fn
=
theano
.
function
([
A
],
gpu_matrix_inverse
(
A
),
mode
=
mode_with_gpu
)
N
=
1000
N
=
1000
A_val
=
rand
(
N
,
N
)
.
astype
(
'float32'
)
test_rng
=
np
.
random
.
RandomState
(
seed
=
1
)
# Copied from theano.tensor.tests.test_basic.rand.
A_val
=
test_rng
.
rand
(
N
,
N
)
.
astype
(
'float32'
)
*
2
-
1
A_val_inv
=
fn
(
A_val
)
A_val_inv
=
fn
(
A_val
)
utt
.
assert_allclose
(
np
.
dot
(
A_val_inv
,
A_val
),
np
.
eye
(
N
),
atol
=
1
e-3
)
utt
.
assert_allclose
(
np
.
eye
(
N
),
np
.
dot
(
A_val_inv
,
A_val
),
atol
=
5
e-3
)
def
test_gpu_matrix_inverse_inplace
(
self
):
def
test_gpu_matrix_inverse_inplace
(
self
):
N
=
1000
N
=
1000
A_val_gpu
=
gpuarray_shared_constructor
(
rand
(
N
,
N
)
.
astype
(
'float32'
))
test_rng
=
np
.
random
.
RandomState
(
seed
=
1
)
A_val_gpu
=
gpuarray_shared_constructor
(
test_rng
.
rand
(
N
,
N
)
.
astype
(
'float32'
)
*
2
-
1
)
A_val_copy
=
A_val_gpu
.
get_value
()
A_val_copy
=
A_val_gpu
.
get_value
()
fn
=
theano
.
function
([],
GpuMagmaMatrixInverse
(
inplace
=
True
)(
A_val_gpu
),
fn
=
theano
.
function
([],
GpuMagmaMatrixInverse
(
inplace
=
True
)(
A_val_gpu
),
mode
=
mode_with_gpu
,
accept_inplace
=
True
)
mode
=
mode_with_gpu
,
accept_inplace
=
True
)
fn
()
fn
()
utt
.
assert_allclose
(
np
.
dot
(
A_val_gpu
.
get_value
(),
A_val_copy
),
np
.
eye
(
N
),
atol
=
1
e-3
)
utt
.
assert_allclose
(
np
.
eye
(
N
),
np
.
dot
(
A_val_gpu
.
get_value
(),
A_val_copy
),
atol
=
5
e-3
)
def
test_gpu_matrix_inverse_inplace_opt
(
self
):
def
test_gpu_matrix_inverse_inplace_opt
(
self
):
A
=
theano
.
tensor
.
fmatrix
(
"A"
)
A
=
theano
.
tensor
.
fmatrix
(
"A"
)
...
...
theano/tests/unittest_tools.py
浏览文件 @
e2ee93fc
...
@@ -352,9 +352,9 @@ class WrongValue(Exception):
...
@@ -352,9 +352,9 @@ class WrongValue(Exception):
return
s
+
str_diagnostic
(
self
.
val1
,
self
.
val2
,
self
.
rtol
,
self
.
atol
)
return
s
+
str_diagnostic
(
self
.
val1
,
self
.
val2
,
self
.
rtol
,
self
.
atol
)
def
assert_allclose
(
val1
,
val2
,
rtol
=
None
,
atol
=
None
):
def
assert_allclose
(
expected
,
value
,
rtol
=
None
,
atol
=
None
):
if
not
T
.
basic
.
_allclose
(
val1
,
val2
,
rtol
,
atol
):
if
not
T
.
basic
.
_allclose
(
expected
,
value
,
rtol
,
atol
):
raise
WrongValue
(
val1
,
val2
,
rtol
,
atol
)
raise
WrongValue
(
expected
,
value
,
rtol
,
atol
)
class
AttemptManyTimes
:
class
AttemptManyTimes
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论