Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
bb999046
提交
bb999046
authored
5月 18, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
6月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use C version of time in scan_perform.pyx
上级
deca03cf
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
13 行删除
+13
-13
scan_perform.c
aesara/scan/c_code/scan_perform.c
+0
-0
scan_perform.pyx
aesara/scan/scan_perform.pyx
+12
-12
scan_perform_ext.py
aesara/scan/scan_perform_ext.py
+1
-1
没有找到文件。
aesara/scan/c_code/scan_perform.c
浏览文件 @
bb999046
差异被折叠。
点击展开。
aesara/scan/scan_perform.pyx
浏览文件 @
bb999046
...
...
@@ -46,15 +46,15 @@
ones (where applicable). All this information is described (more or less)
by describing the arguments of this function)
"""
import sys
from libc.time cimport time, time_t
import cython
import numpy
import numpy
cimport numpy
import copy
import time
import sys
from aesara.scan.utils import InnerFunctionError
...
...
@@ -62,7 +62,7 @@ numpy.import_array()
def get_version():
return 0.3
19
return 0.3
20
# TODO: We need to get rid of the negative indexing performed with `pos` and `l`.
# @cython.wraparound(False)
...
...
@@ -94,7 +94,7 @@ def perform(
tuple outer_output_dtypes not None,
tuple outer_output_ndims not None,
fn,
) -> (
floa
t, int):
) -> (
time_
t, int):
"""
Parameters
----------
...
...
@@ -164,9 +164,9 @@ def perform(
"""
# 1. Unzip the number of steps and sequences. If number of steps is
# negative flip sequences around, and make n_steps positive
cdef
floa
t t_fn = 0
cdef
floa
t t0_fn
cdef
floa
t dt_fn
cdef
time_
t t_fn = 0
cdef
time_
t t0_fn
cdef
time_
t dt_fn
cdef unsigned int n_steps = outer_inputs[0].item()
cdef unsigned int n_outs = n_mit_mot + n_mit_sot + n_sit_sot
cdef unsigned int seqs_arg_offset = n_seqs + 1
...
...
@@ -407,14 +407,14 @@ def perform(
old_mitmot_input_data[idx] = var.data
# 5.1 compute outputs
t0_fn = time
.time(
)
t0_fn = time
(NULL
)
try:
fn()
except Exception as exc:
raise InnerFunctionError(exc, sys.exc_info()[2])
dt_fn = time
.time(
) - t0_fn
dt_fn = time
(NULL
) - t0_fn
t_fn += dt_fn
if as_while:
pdx = offset + n_shared_outs
...
...
aesara/scan/scan_perform_ext.py
浏览文件 @
bb999046
...
...
@@ -23,7 +23,7 @@ if not config.cxx:
_logger
=
logging
.
getLogger
(
"aesara.scan.scan_perform"
)
version
=
0.3
19
# must match constant returned in function get_version()
version
=
0.3
20
# must match constant returned in function get_version()
need_reload
=
False
scan_perform
:
Optional
[
ModuleType
]
=
None
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论