Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7bb08f51
提交
7bb08f51
authored
1月 26, 2017
作者:
Benjamin Scellier
提交者:
Nicolas Ballas
2月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
file theano/gof/tests/test_vm.py
上级
d159de11
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
7 行删除
+6
-7
test_vm.py
theano/gof/tests/test_vm.py
+6
-7
没有找到文件。
theano/gof/tests/test_vm.py
浏览文件 @
7bb08f51
...
...
@@ -5,7 +5,7 @@ import time
import
unittest
from
nose.plugins.skip
import
SkipTest
import
numpy
import
numpy
as
np
from
six
import
itervalues
from
theano
import
function
...
...
@@ -92,7 +92,7 @@ def test_speed():
def
time_numpy
():
steps_a
=
5
steps_b
=
100
x
=
n
umpy
.
asarray
([
2.0
,
3.0
],
dtype
=
theano
.
config
.
floatX
)
x
=
n
p
.
asarray
([
2.0
,
3.0
],
dtype
=
theano
.
config
.
floatX
)
numpy_version
(
x
,
steps_a
)
t0
=
time
.
time
()
...
...
@@ -195,7 +195,6 @@ def test_speed_lazy():
def
test_partial_function
():
import
numpy
as
np
from
theano.tests
import
unittest_tools
as
utt
def
check_partial_function
(
linker_name
):
...
...
@@ -234,7 +233,7 @@ def test_partial_function_with_updates():
def
check_updates
(
linker_name
):
x
=
tensor
.
lscalar
(
'input'
)
y
=
theano
.
shared
(
n
umpy
.
asarray
(
1
,
'int64'
),
name
=
'global'
)
y
=
theano
.
shared
(
n
p
.
asarray
(
1
,
'int64'
),
name
=
'global'
)
f
=
theano
.
function
([
x
],
[
x
,
x
+
34
],
updates
=
[(
y
,
x
+
1
)],
mode
=
Mode
(
optimizer
=
None
,
linker
=
linker_name
))
g
=
theano
.
function
([
x
],
[
x
-
6
],
updates
=
[(
y
,
y
+
3
)],
mode
=
Mode
(
...
...
@@ -283,7 +282,7 @@ if run_memory_usage_tests:
def
test_leak2
():
import
theano.sandbox.cuda
as
cuda
for
i
in
xrange
(
1000000
):
n
=
n
umpy
.
asarray
([
2.3
,
4.5
],
dtype
=
'f'
)
n
=
n
p
.
asarray
([
2.3
,
4.5
],
dtype
=
'f'
)
c
=
sys
.
getrefcount
(
n
)
a
=
cuda
.
CudaNdarray
(
n
)
a
.
sum
()
...
...
@@ -338,7 +337,7 @@ if run_memory_usage_tests:
f_a
=
function
([
x
],
a
,
mode
=
Mode
(
optimizer
=
None
,
linker
=
linker
()))
inp
=
n
umpy
.
random
.
rand
(
1000000
)
inp
=
n
p
.
random
.
rand
(
1000000
)
for
i
in
xrange
(
100
):
f_a
(
inp
)
if
0
:
# this doesn't seem to work, prints 0 for everything
...
...
@@ -375,7 +374,7 @@ if run_memory_usage_tests:
f_a
=
function
([
x
],
a
,
mode
=
Mode
(
optimizer
=
None
,
linker
=
linker
()))
inp
=
n
umpy
.
random
.
rand
(
1000000
)
inp
=
n
p
.
random
.
rand
(
1000000
)
for
i
in
xrange
(
500
):
f_a
(
inp
)
print
(
1
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论