Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
84b61a6c
提交
84b61a6c
authored
7月 12, 2017
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tests for MRG float16
上级
5647b421
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
0 行删除
+15
-0
test_rng_mrg.py
theano/gpuarray/tests/test_rng_mrg.py
+5
-0
test_rng_mrg.py
theano/sandbox/tests/test_rng_mrg.py
+10
-0
没有找到文件。
theano/gpuarray/tests/test_rng_mrg.py
浏览文件 @
84b61a6c
...
@@ -9,6 +9,7 @@ from theano.configparser import change_flags
...
@@ -9,6 +9,7 @@ from theano.configparser import change_flags
from
theano.sandbox
import
rng_mrg
from
theano.sandbox
import
rng_mrg
from
theano.sandbox.rng_mrg
import
MRG_RandomStreams
from
theano.sandbox.rng_mrg
import
MRG_RandomStreams
from
theano.sandbox.tests.test_rng_mrg
import
java_samples
,
rng_mrg_overflow
from
theano.sandbox.tests.test_rng_mrg
import
java_samples
,
rng_mrg_overflow
from
theano.sandbox.tests.test_rng_mrg
import
test_f16_nonzero
as
cpu_f16_nonzero
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests
import
unittest_tools
as
utt
from
.config
import
mode_with_gpu
as
mode
from
.config
import
mode_with_gpu
as
mode
...
@@ -162,3 +163,7 @@ def test_validate_input_types_gpuarray_backend():
...
@@ -162,3 +163,7 @@ def test_validate_input_types_gpuarray_backend():
rstate
=
np
.
zeros
((
7
,
6
),
dtype
=
"int32"
)
rstate
=
np
.
zeros
((
7
,
6
),
dtype
=
"int32"
)
rstate
=
gpuarray_shared_constructor
(
rstate
)
rstate
=
gpuarray_shared_constructor
(
rstate
)
rng_mrg
.
mrg_uniform
.
new
(
rstate
,
ndim
=
None
,
dtype
=
"float32"
,
size
=
(
3
,))
rng_mrg
.
mrg_uniform
.
new
(
rstate
,
ndim
=
None
,
dtype
=
"float32"
,
size
=
(
3
,))
def
test_f16_nonzero
():
cpu_f16_nonzero
(
mode
=
mode
,
op_to_check
=
GPUA_mrg_uniform
)
theano/sandbox/tests/test_rng_mrg.py
浏览文件 @
84b61a6c
...
@@ -751,6 +751,16 @@ def test_undefined_grad():
...
@@ -751,6 +751,16 @@ def test_undefined_grad():
(
avg
,
std
))
(
avg
,
std
))
def
test_f16_nonzero
(
mode
=
None
,
op_to_check
=
rng_mrg
.
mrg_uniform
):
srng
=
MRG_RandomStreams
(
seed
=
utt
.
fetch_seed
())
m
=
srng
.
uniform
(
size
=
(
1000
,
1000
),
dtype
=
'float16'
)
assert
m
.
dtype
==
'float16'
,
m
.
type
f
=
theano
.
function
([],
m
,
mode
=
mode
)
assert
any
(
isinstance
(
n
.
op
,
op_to_check
)
for
n
in
f
.
maker
.
fgraph
.
apply_nodes
)
m_val
=
f
()
assert
np
.
all
((
0
<
m_val
)
&
(
m_val
<
1
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
rng
=
MRG_RandomStreams
(
np
.
random
.
randint
(
2147462579
))
rng
=
MRG_RandomStreams
(
np
.
random
.
randint
(
2147462579
))
print
(
theano
.
__file__
)
print
(
theano
.
__file__
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论