Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6a4445a1
提交
6a4445a1
authored
8月 11, 2011
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync between cython implementation of scan and cython one.
上级
815b54cb
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
24 行增加
和
2 行删除
+24
-2
scan_perform.pyx
theano/scan_module/scan_perform.pyx
+24
-2
没有找到文件。
theano/scan_module/scan_perform.pyx
浏览文件 @
6a4445a1
...
@@ -56,7 +56,7 @@ import cython
...
@@ -56,7 +56,7 @@ import cython
import numpy
import numpy
cimport numpy
cimport numpy
from theano import gof
import time
import time
import copy
import copy
from theano.sandbox import cuda
from theano.sandbox import cuda
...
@@ -331,7 +331,19 @@ def perform(
...
@@ -331,7 +331,19 @@ def perform(
output_storage[<unsigned int>pdx].storage[0] = None
output_storage[<unsigned int>pdx].storage[0] = None
# 5. compute outputs
# 5. compute outputs
t0_fn = time.time()
t0_fn = time.time()
fn()
try:
fn()
except Exception:
if hasattr(fn, 'position_of_error'):
# this is a new vm-provided function
# the C VM needs this because the exception manipulation
# done by raise_with_op is not implemented in C.
gof.vm.raise_with_op(fn.nodes[fn.position_of_error])
else:
# old-style linkers raise their own exceptions
raise
dt_fn = time.time() - t0_fn
dt_fn = time.time() - t0_fn
t_fn += dt_fn
t_fn += dt_fn
if self.as_while:
if self.as_while:
...
@@ -435,6 +447,16 @@ def perform(
...
@@ -435,6 +447,16 @@ def perform(
elif store_steps[idx] > i - self.mintaps[idx]:
elif store_steps[idx] > i - self.mintaps[idx]:
outs[idx][0][i-self.mintaps[idx]:] = 0
outs[idx][0][i-self.mintaps[idx]:] = 0
# This is a fix for a bug introduced by while. If you say
# you want to loop up to a condition, you expect the output
# to have that length ( and not the maximal length possible)
#
# Without this the behaviour of a scan op is not consistent
# if optimization gets applied compared to when optimization
# do not get applied
if i < n_steps:
outs[idx][0] = outs[idx][0][:-(n_steps - i)]
t_call = time.time() - t0_call
t_call = time.time() - t0_call
if hasattr(fnct.maker, 'profile'):
if hasattr(fnct.maker, 'profile'):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论