Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c6875ba4
提交
c6875ba4
authored
8月 19, 2012
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #869 from pascanur/fix_sandbox_scan
fix to annoying error message of sandbox/scan
上级
b474b0b2
d7766b1a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
1 行删除
+15
-1
scan.py
theano/sandbox/scan.py
+3
-1
test_scan.py
theano/sandbox/test_scan.py
+12
-0
没有找到文件。
theano/sandbox/scan.py
浏览文件 @
c6875ba4
...
@@ -262,7 +262,9 @@ def scan(fn,
...
@@ -262,7 +262,9 @@ def scan(fn,
# makes code much cleaner for those who do not use taps. Otherwise
# makes code much cleaner for those who do not use taps. Otherwise
# they would always had to shape_padleft the initial state ..
# they would always had to shape_padleft the initial state ..
# which is ugly
# which is ugly
if
init_out
[
'taps'
]
==
[
-
1
]:
# Note, 'taps' might not be in the dictionary
if
'taps'
in
init_out
and
init_out
[
'taps'
]
==
[
-
1
]:
actual_arg
=
init_out
[
'membuf'
]
actual_arg
=
init_out
[
'membuf'
]
arg
=
safe_new
(
init_out
[
'membuf'
][
0
])
arg
=
safe_new
(
init_out
[
'membuf'
][
0
])
...
...
theano/sandbox/test_scan.py
浏览文件 @
c6875ba4
...
@@ -62,10 +62,22 @@ def test_004():
...
@@ -62,10 +62,22 @@ def test_004():
val_sq
=
numpy
.
float32
([
1
,
2
,
3
,
4
,
5
])
val_sq
=
numpy
.
float32
([
1
,
2
,
3
,
4
,
5
])
assert
numpy
.
all
(
fn
(
val_sq
,
5
)
==
val_sq
+
1
)
assert
numpy
.
all
(
fn
(
val_sq
,
5
)
==
val_sq
+
1
)
def
test_005
():
sq
=
theano
.
tensor
.
fvector
(
'sq'
)
nst
=
theano
.
tensor
.
iscalar
(
'nst'
)
out
,
_
=
scan
.
scan
(
lambda
s
:
s
+
numpy
.
float32
(
1
),
sequences
=
sq
,
states
=
[
None
],
n_steps
=
nst
)
fn
=
theano
.
function
([
sq
,
nst
],
out
)
val_sq
=
numpy
.
float32
([
1
,
2
,
3
,
4
,
5
])
assert
numpy
.
all
(
fn
(
val_sq
,
5
)
==
val_sq
+
1
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_001
()
test_001
()
test_002
()
test_002
()
test_003
()
test_003
()
test_004
()
test_004
()
test_005
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论