Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
77c7836e
提交
77c7836e
authored
5月 23, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
6月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify array copying in scan_perform.pyx
上级
12cf4a49
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
117 行增加
和
193 行删除
+117
-193
scan_perform.c
aesara/scan/c_code/scan_perform.c
+113
-185
scan_perform.pyx
aesara/scan/scan_perform.pyx
+3
-7
scan_perform_ext.py
aesara/scan/scan_perform_ext.py
+1
-1
没有找到文件。
aesara/scan/c_code/scan_perform.c
浏览文件 @
77c7836e
...
@@ -2775,7 +2775,7 @@ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /
...
@@ -2775,7 +2775,7 @@ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /
static
PyObject
*
__pyx_tp_new_memoryview
(
PyTypeObject
*
t
,
PyObject
*
a
,
PyObject
*
k
);
/*proto*/
static
PyObject
*
__pyx_tp_new_memoryview
(
PyTypeObject
*
t
,
PyObject
*
a
,
PyObject
*
k
);
/*proto*/
static
PyObject
*
__pyx_tp_new__memoryviewslice
(
PyTypeObject
*
t
,
PyObject
*
a
,
PyObject
*
k
);
/*proto*/
static
PyObject
*
__pyx_tp_new__memoryviewslice
(
PyTypeObject
*
t
,
PyObject
*
a
,
PyObject
*
k
);
/*proto*/
static
PyObject
*
__pyx_float_0_0
;
static
PyObject
*
__pyx_float_0_0
;
static
PyObject
*
__pyx_float_0_32
3
;
static
PyObject
*
__pyx_float_0_32
4
;
static
PyObject
*
__pyx_int_0
;
static
PyObject
*
__pyx_int_0
;
static
PyObject
*
__pyx_int_1
;
static
PyObject
*
__pyx_int_1
;
static
PyObject
*
__pyx_int_184977713
;
static
PyObject
*
__pyx_int_184977713
;
...
@@ -2819,7 +2819,7 @@ static PyObject *__pyx_codeobj__33;
...
@@ -2819,7 +2819,7 @@ static PyObject *__pyx_codeobj__33;
*
*
*
*
* def get_version(): # <<<<<<<<<<<<<<
* def get_version(): # <<<<<<<<<<<<<<
* return 0.32
3
* return 0.32
4
*
*
*/
*/
...
@@ -2845,20 +2845,20 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_get_version(CYTHON_UNUSED
...
@@ -2845,20 +2845,20 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_get_version(CYTHON_UNUSED
/* "aesara/scan/scan_perform.pyx":65
/* "aesara/scan/scan_perform.pyx":65
*
*
* def get_version():
* def get_version():
* return 0.32
3
# <<<<<<<<<<<<<<
* return 0.32
4
# <<<<<<<<<<<<<<
*
*
*
*
*/
*/
__Pyx_XDECREF
(
__pyx_r
);
__Pyx_XDECREF
(
__pyx_r
);
__Pyx_INCREF
(
__pyx_float_0_32
3
);
__Pyx_INCREF
(
__pyx_float_0_32
4
);
__pyx_r
=
__pyx_float_0_32
3
;
__pyx_r
=
__pyx_float_0_32
4
;
goto
__pyx_L0
;
goto
__pyx_L0
;
/* "aesara/scan/scan_perform.pyx":64
/* "aesara/scan/scan_perform.pyx":64
*
*
*
*
* def get_version(): # <<<<<<<<<<<<<<
* def get_version(): # <<<<<<<<<<<<<<
* return 0.32
3
* return 0.32
4
*
*
*/
*/
...
@@ -6833,89 +6833,53 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -6833,89 +6833,53 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
/* "aesara/scan/scan_perform.pyx":559
/* "aesara/scan/scan_perform.pyx":559
* # This way, there will be no information overwritten
* # This way, there will be no information overwritten
* # before it is read (as it used to happen).
* # before it is read (as it used to happen).
*
shape = (pdx,)+ outer_outputs_idx_0.shape[1:]
# <<<<<<<<<<<<<<
*
tmp = outer_outputs_idx_0[:pdx].copy()
# <<<<<<<<<<<<<<
*
tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
*
outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:]
*
tmp[:] = outer_outputs_idx_0[:pdx]
*
outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
*/
*/
__pyx_t_1
=
__Pyx_PyInt_From_unsigned_int
(
__pyx_v_pdx
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
__pyx_t_3
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
0
,
__pyx_v_pdx
,
NULL
,
NULL
,
NULL
,
0
,
1
,
0
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__pyx_t_3
=
PyTuple_New
(
1
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_GIVEREF
(
__pyx_t_1
);
__pyx_t_2
=
__Pyx_PyObject_GetAttrStr
(
__pyx_t_3
,
__pyx_n_s_copy
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
PyTuple_SET_ITEM
(
__pyx_t_3
,
0
,
__pyx_t_1
);
__pyx_t_1
=
0
;
__pyx_t_1
=
__Pyx_PyObject_GetAttrStr
(
__pyx_v_outer_outputs_idx_0
,
__pyx_n_s_shape
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__pyx_t_2
=
__Pyx_PyObject_GetSlice
(
__pyx_t_1
,
1
,
0
,
NULL
,
NULL
,
&
__pyx_slice_
,
1
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_2
);
__Pyx_GOTREF
(
__pyx_t_2
);
__Pyx_DECREF
(
__pyx_t_1
);
__pyx_t_1
=
0
;
__pyx_t_1
=
PyNumber_Add
(
__pyx_t_3
,
__pyx_t_2
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__pyx_t_3
=
NULL
;
if
(
CYTHON_UNPACK_METHODS
&&
likely
(
PyMethod_Check
(
__pyx_t_2
)))
{
__pyx_t_3
=
PyMethod_GET_SELF
(
__pyx_t_2
);
if
(
likely
(
__pyx_t_3
))
{
PyObject
*
function
=
PyMethod_GET_FUNCTION
(
__pyx_t_2
);
__Pyx_INCREF
(
__pyx_t_3
);
__Pyx_INCREF
(
function
);
__Pyx_DECREF_SET
(
__pyx_t_2
,
function
);
}
}
__pyx_t_1
=
(
__pyx_t_3
)
?
__Pyx_PyObject_CallOneArg
(
__pyx_t_2
,
__pyx_t_3
)
:
__Pyx_PyObject_CallNoArg
(
__pyx_t_2
);
__Pyx_XDECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
559
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__Pyx_DECREF
(
__pyx_t_2
);
__pyx_t_2
=
0
;
__Pyx_DECREF
(
__pyx_t_2
);
__pyx_t_2
=
0
;
__Pyx_XDECREF_SET
(
__pyx_v_
shape
,
__pyx_t_1
);
__Pyx_XDECREF_SET
(
__pyx_v_
tmp
,
__pyx_t_1
);
__pyx_t_1
=
0
;
__pyx_t_1
=
0
;
/* "aesara/scan/scan_perform.pyx":560
/* "aesara/scan/scan_perform.pyx":560
* # before it is read (as it used to happen).
* # before it is read (as it used to happen).
* shape = (pdx,)+ outer_outputs_idx_0.shape[1:]
* tmp = outer_outputs_idx_0[:pdx].copy()
* tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx]) # <<<<<<<<<<<<<<
* tmp[:] = outer_outputs_idx_0[:pdx]
* outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:]
*/
__Pyx_GetModuleGlobalName
(
__pyx_t_1
,
__pyx_n_s_numpy
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__pyx_t_2
=
__Pyx_PyObject_GetAttrStr
(
__pyx_t_1
,
__pyx_n_s_empty
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_2
);
__Pyx_DECREF
(
__pyx_t_1
);
__pyx_t_1
=
0
;
__pyx_t_1
=
PyTuple_New
(
1
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__Pyx_INCREF
(
__pyx_v_shape
);
__Pyx_GIVEREF
(
__pyx_v_shape
);
PyTuple_SET_ITEM
(
__pyx_t_1
,
0
,
__pyx_v_shape
);
__pyx_t_3
=
__Pyx_PyDict_NewPresized
(
1
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
if
(
PyDict_SetItem
(
__pyx_t_3
,
__pyx_n_s_dtype
,
PyTuple_GET_ITEM
(
__pyx_v_outer_output_dtypes
,
__pyx_v_idx
))
<
0
)
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__pyx_t_16
=
__Pyx_PyObject_Call
(
__pyx_t_2
,
__pyx_t_1
,
__pyx_t_3
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_16
);
__Pyx_DECREF
(
__pyx_t_2
);
__pyx_t_2
=
0
;
__Pyx_DECREF
(
__pyx_t_1
);
__pyx_t_1
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_XDECREF_SET
(
__pyx_v_tmp
,
__pyx_t_16
);
__pyx_t_16
=
0
;
/* "aesara/scan/scan_perform.pyx":561
* shape = (pdx,)+ outer_outputs_idx_0.shape[1:]
* tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
* tmp[:] = outer_outputs_idx_0[:pdx] # <<<<<<<<<<<<<<
* outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:]
* outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
*/
__pyx_t_16
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
0
,
__pyx_v_pdx
,
NULL
,
NULL
,
NULL
,
0
,
1
,
0
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
561
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_16
);
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_tmp
,
__pyx_t_16
,
0
,
0
,
NULL
,
NULL
,
&
__pyx_slice__2
,
0
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
561
,
__pyx_L1_error
)
__Pyx_DECREF
(
__pyx_t_16
);
__pyx_t_16
=
0
;
/* "aesara/scan/scan_perform.pyx":562
* tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
* tmp[:] = outer_outputs_idx_0[:pdx]
* outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:] # <<<<<<<<<<<<<<
* outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:] # <<<<<<<<<<<<<<
* outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
* outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
* else:
* else:
*/
*/
__pyx_t_1
6
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_pdx
,
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
562
,
__pyx_L1_error
)
__pyx_t_1
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_pdx
,
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
6
);
__Pyx_GOTREF
(
__pyx_t_1
);
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_t_1
6
,
0
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
NULL
,
NULL
,
NULL
,
0
,
1
,
0
)
<
0
)
__PYX_ERR
(
0
,
562
,
__pyx_L1_error
)
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_t_1
,
0
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
NULL
,
NULL
,
NULL
,
0
,
1
,
0
)
<
0
)
__PYX_ERR
(
0
,
560
,
__pyx_L1_error
)
__Pyx_DECREF
(
__pyx_t_1
6
);
__pyx_t_16
=
0
;
__Pyx_DECREF
(
__pyx_t_1
);
__pyx_t_1
=
0
;
/* "aesara/scan/scan_perform.pyx":56
3
/* "aesara/scan/scan_perform.pyx":56
1
* tmp
[:] = outer_outputs_idx_0[:pdx]
* tmp
= outer_outputs_idx_0[:pdx].copy()
* outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:]
* outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:]
* outer_outputs_idx_0[store_steps_idx - pdx:] = tmp # <<<<<<<<<<<<<<
* outer_outputs_idx_0[store_steps_idx - pdx:] = tmp # <<<<<<<<<<<<<<
* else:
* else:
*
shape = (store_steps_idx - pdx,) + outer_outputs_idx_0.shape[1:]
*
tmp = outer_outputs_idx_0[pdx:].copy()
*/
*/
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_tmp
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
56
3
,
__pyx_L1_error
)
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_tmp
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
56
1
,
__pyx_L1_error
)
/* "aesara/scan/scan_perform.pyx":552
/* "aesara/scan/scan_perform.pyx":552
*
*
...
@@ -6927,93 +6891,57 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -6927,93 +6891,57 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
goto
__pyx_L128
;
goto
__pyx_L128
;
}
}
/* "aesara/scan/scan_perform.pyx":56
5
/* "aesara/scan/scan_perform.pyx":56
3
* outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
* outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
* else:
* else:
*
shape = (store_steps_idx - pdx,) + outer_outputs_idx_0.shape[1:]
# <<<<<<<<<<<<<<
*
tmp = outer_outputs_idx_0[pdx:].copy()
# <<<<<<<<<<<<<<
*
tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
*
outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx]
*
tmp[:] = outer_outputs_idx_0[pdx:]
*
outer_outputs_idx_0[:store_steps_idx - pdx] = tmp
*/
*/
/*else*/
{
/*else*/
{
__pyx_t_
16
=
__Pyx_PyInt_From_unsigned_int
((
__pyx_v_store_steps_idx
-
__pyx_v_pdx
));
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
565
,
__pyx_L1_error
)
__pyx_t_
2
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_pdx
,
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
563
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_
16
);
__Pyx_GOTREF
(
__pyx_t_
2
);
__pyx_t_3
=
PyTuple_New
(
1
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
565
,
__pyx_L1_error
)
__pyx_t_3
=
__Pyx_PyObject_GetAttrStr
(
__pyx_t_2
,
__pyx_n_s_copy
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
563
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_GIVEREF
(
__pyx_t_16
);
__Pyx_DECREF
(
__pyx_t_2
);
__pyx_t_2
=
0
;
PyTuple_SET_ITEM
(
__pyx_t_3
,
0
,
__pyx_t_16
);
__pyx_t_2
=
NULL
;
__pyx_t_16
=
0
;
if
(
CYTHON_UNPACK_METHODS
&&
likely
(
PyMethod_Check
(
__pyx_t_3
)))
{
__pyx_t_16
=
__Pyx_PyObject_GetAttrStr
(
__pyx_v_outer_outputs_idx_0
,
__pyx_n_s_shape
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
565
,
__pyx_L1_error
)
__pyx_t_2
=
PyMethod_GET_SELF
(
__pyx_t_3
);
__Pyx_GOTREF
(
__pyx_t_16
);
if
(
likely
(
__pyx_t_2
))
{
__pyx_t_1
=
__Pyx_PyObject_GetSlice
(
__pyx_t_16
,
1
,
0
,
NULL
,
NULL
,
&
__pyx_slice_
,
1
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
565
,
__pyx_L1_error
)
PyObject
*
function
=
PyMethod_GET_FUNCTION
(
__pyx_t_3
);
__Pyx_INCREF
(
__pyx_t_2
);
__Pyx_INCREF
(
function
);
__Pyx_DECREF_SET
(
__pyx_t_3
,
function
);
}
}
__pyx_t_1
=
(
__pyx_t_2
)
?
__Pyx_PyObject_CallOneArg
(
__pyx_t_3
,
__pyx_t_2
)
:
__Pyx_PyObject_CallNoArg
(
__pyx_t_3
);
__Pyx_XDECREF
(
__pyx_t_2
);
__pyx_t_2
=
0
;
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
563
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__Pyx_GOTREF
(
__pyx_t_1
);
__Pyx_DECREF
(
__pyx_t_16
);
__pyx_t_16
=
0
;
__pyx_t_16
=
PyNumber_Add
(
__pyx_t_3
,
__pyx_t_1
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
565
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_16
);
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_DECREF
(
__pyx_t_1
);
__pyx_t_1
=
0
;
__Pyx_XDECREF_SET
(
__pyx_v_tmp
,
__pyx_t_1
);
__Pyx_XDECREF_SET
(
__pyx_v_shape
,
__pyx_t_16
);
__pyx_t_1
=
0
;
__pyx_t_16
=
0
;
/* "aesara/scan/scan_perform.pyx":56
6
/* "aesara/scan/scan_perform.pyx":56
4
* else:
* else:
* shape = (store_steps_idx - pdx,) + outer_outputs_idx_0.shape[1:]
* tmp = outer_outputs_idx_0[pdx:].copy()
* tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx]) # <<<<<<<<<<<<<<
* tmp[:] = outer_outputs_idx_0[pdx:]
* outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx]
*/
__Pyx_GetModuleGlobalName
(
__pyx_t_16
,
__pyx_n_s_numpy
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
566
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_16
);
__pyx_t_1
=
__Pyx_PyObject_GetAttrStr
(
__pyx_t_16
,
__pyx_n_s_empty
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
566
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__Pyx_DECREF
(
__pyx_t_16
);
__pyx_t_16
=
0
;
__pyx_t_16
=
PyTuple_New
(
1
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
566
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_16
);
__Pyx_INCREF
(
__pyx_v_shape
);
__Pyx_GIVEREF
(
__pyx_v_shape
);
PyTuple_SET_ITEM
(
__pyx_t_16
,
0
,
__pyx_v_shape
);
__pyx_t_3
=
__Pyx_PyDict_NewPresized
(
1
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
566
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
if
(
PyDict_SetItem
(
__pyx_t_3
,
__pyx_n_s_dtype
,
PyTuple_GET_ITEM
(
__pyx_v_outer_output_dtypes
,
__pyx_v_idx
))
<
0
)
__PYX_ERR
(
0
,
566
,
__pyx_L1_error
)
__pyx_t_2
=
__Pyx_PyObject_Call
(
__pyx_t_1
,
__pyx_t_16
,
__pyx_t_3
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
566
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_2
);
__Pyx_DECREF
(
__pyx_t_1
);
__pyx_t_1
=
0
;
__Pyx_DECREF
(
__pyx_t_16
);
__pyx_t_16
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_XDECREF_SET
(
__pyx_v_tmp
,
__pyx_t_2
);
__pyx_t_2
=
0
;
/* "aesara/scan/scan_perform.pyx":567
* shape = (store_steps_idx - pdx,) + outer_outputs_idx_0.shape[1:]
* tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
* tmp[:] = outer_outputs_idx_0[pdx:] # <<<<<<<<<<<<<<
* outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx]
* outer_outputs_idx_0[:store_steps_idx - pdx] = tmp
*/
__pyx_t_2
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_pdx
,
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
567
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_2
);
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_tmp
,
__pyx_t_2
,
0
,
0
,
NULL
,
NULL
,
&
__pyx_slice__2
,
0
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
567
,
__pyx_L1_error
)
__Pyx_DECREF
(
__pyx_t_2
);
__pyx_t_2
=
0
;
/* "aesara/scan/scan_perform.pyx":568
* tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
* tmp[:] = outer_outputs_idx_0[pdx:]
* outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx] # <<<<<<<<<<<<<<
* outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx] # <<<<<<<<<<<<<<
* outer_outputs_idx_0[:store_steps_idx - pdx] = tmp
* outer_outputs_idx_0[:store_steps_idx - pdx] = tmp
*
*
*/
*/
__pyx_t_
2
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
0
,
__pyx_v_pdx
,
NULL
,
NULL
,
NULL
,
0
,
1
,
0
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
568
,
__pyx_L1_error
)
__pyx_t_
1
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
0
,
__pyx_v_pdx
,
NULL
,
NULL
,
NULL
,
0
,
1
,
0
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
564
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_
2
);
__Pyx_GOTREF
(
__pyx_t_
1
);
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_t_
2
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
568
,
__pyx_L1_error
)
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_t_
1
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
564
,
__pyx_L1_error
)
__Pyx_DECREF
(
__pyx_t_
2
);
__pyx_t_2
=
0
;
__Pyx_DECREF
(
__pyx_t_
1
);
__pyx_t_1
=
0
;
/* "aesara/scan/scan_perform.pyx":56
9
/* "aesara/scan/scan_perform.pyx":56
5
* tmp
[:] = outer_outputs_idx_0[pdx:]
* tmp
= outer_outputs_idx_0[pdx:].copy()
* outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx]
* outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx]
* outer_outputs_idx_0[:store_steps_idx - pdx] = tmp # <<<<<<<<<<<<<<
* outer_outputs_idx_0[:store_steps_idx - pdx] = tmp # <<<<<<<<<<<<<<
*
*
* # This would normally happen only when doing truncated
* # This would normally happen only when doing truncated
*/
*/
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_tmp
,
0
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
NULL
,
NULL
,
NULL
,
0
,
1
,
0
)
<
0
)
__PYX_ERR
(
0
,
56
9
,
__pyx_L1_error
)
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_v_tmp
,
0
,
(
__pyx_v_store_steps_idx
-
__pyx_v_pdx
),
NULL
,
NULL
,
NULL
,
0
,
1
,
0
)
<
0
)
__PYX_ERR
(
0
,
56
5
,
__pyx_L1_error
)
}
}
__pyx_L128:
;
__pyx_L128:
;
...
@@ -7027,7 +6955,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7027,7 +6955,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
goto
__pyx_L125
;
goto
__pyx_L125
;
}
}
/* "aesara/scan/scan_perform.pyx":57
5
/* "aesara/scan/scan_perform.pyx":57
1
* # expected to return 0 for all entries for which the gradient is
* # expected to return 0 for all entries for which the gradient is
* # not actually computed
* # not actually computed
* elif store_steps_idx > i - mintaps_idx: # <<<<<<<<<<<<<<
* elif store_steps_idx > i - mintaps_idx: # <<<<<<<<<<<<<<
...
@@ -7037,16 +6965,16 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7037,16 +6965,16 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
__pyx_t_5
=
((
__pyx_v_store_steps_idx
>
(
__pyx_v_i
-
__pyx_v_mintaps_idx
))
!=
0
);
__pyx_t_5
=
((
__pyx_v_store_steps_idx
>
(
__pyx_v_i
-
__pyx_v_mintaps_idx
))
!=
0
);
if
(
__pyx_t_5
)
{
if
(
__pyx_t_5
)
{
/* "aesara/scan/scan_perform.pyx":57
6
/* "aesara/scan/scan_perform.pyx":57
2
* # not actually computed
* # not actually computed
* elif store_steps_idx > i - mintaps_idx:
* elif store_steps_idx > i - mintaps_idx:
* outer_outputs_idx_0[i - mintaps_idx:] = 0 # <<<<<<<<<<<<<<
* outer_outputs_idx_0[i - mintaps_idx:] = 0 # <<<<<<<<<<<<<<
*
*
* # This is a fix for a bug introduced by while. If you say
* # This is a fix for a bug introduced by while. If you say
*/
*/
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_int_0
,
(
__pyx_v_i
-
__pyx_v_mintaps_idx
),
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
57
6
,
__pyx_L1_error
)
if
(
__Pyx_PyObject_SetSlice
(
__pyx_v_outer_outputs_idx_0
,
__pyx_int_0
,
(
__pyx_v_i
-
__pyx_v_mintaps_idx
),
0
,
NULL
,
NULL
,
NULL
,
1
,
0
,
0
)
<
0
)
__PYX_ERR
(
0
,
57
2
,
__pyx_L1_error
)
/* "aesara/scan/scan_perform.pyx":58
5
/* "aesara/scan/scan_perform.pyx":58
1
* # if optimization gets applied compared to when optimization
* # if optimization gets applied compared to when optimization
* # do not get applied
* # do not get applied
* if i < n_steps: # <<<<<<<<<<<<<<
* if i < n_steps: # <<<<<<<<<<<<<<
...
@@ -7056,35 +6984,35 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7056,35 +6984,35 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
__pyx_t_5
=
((
__pyx_v_i
<
__pyx_v_n_steps
)
!=
0
);
__pyx_t_5
=
((
__pyx_v_i
<
__pyx_v_n_steps
)
!=
0
);
if
(
__pyx_t_5
)
{
if
(
__pyx_t_5
)
{
/* "aesara/scan/scan_perform.pyx":5
92
/* "aesara/scan/scan_perform.pyx":5
88
* # code faster, so this workaround is better then removing
* # code faster, so this workaround is better then removing
* # the directive.
* # the directive.
* sh0 = outer_outputs_idx_0.shape[0] # <<<<<<<<<<<<<<
* sh0 = outer_outputs_idx_0.shape[0] # <<<<<<<<<<<<<<
* outer_outputs_idx[0] = outer_outputs_idx_0[:sh0-(n_steps - i)]
* outer_outputs_idx[0] = outer_outputs_idx_0[:sh0-(n_steps - i)]
*
*
*/
*/
__pyx_t_
2
=
__Pyx_PyObject_GetAttrStr
(
__pyx_v_outer_outputs_idx_0
,
__pyx_n_s_shape
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
592
,
__pyx_L1_error
)
__pyx_t_
1
=
__Pyx_PyObject_GetAttrStr
(
__pyx_v_outer_outputs_idx_0
,
__pyx_n_s_shape
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
588
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_
2
);
__Pyx_GOTREF
(
__pyx_t_
1
);
__pyx_t_3
=
__Pyx_GetItemInt
(
__pyx_t_
2
,
0
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
592
,
__pyx_L1_error
)
__pyx_t_3
=
__Pyx_GetItemInt
(
__pyx_t_
1
,
0
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
588
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_DECREF
(
__pyx_t_
2
);
__pyx_t_2
=
0
;
__Pyx_DECREF
(
__pyx_t_
1
);
__pyx_t_1
=
0
;
__pyx_t_13
=
__Pyx_PyInt_As_unsigned_int
(
__pyx_t_3
);
if
(
unlikely
((
__pyx_t_13
==
(
unsigned
int
)
-
1
)
&&
PyErr_Occurred
()))
__PYX_ERR
(
0
,
5
92
,
__pyx_L1_error
)
__pyx_t_13
=
__Pyx_PyInt_As_unsigned_int
(
__pyx_t_3
);
if
(
unlikely
((
__pyx_t_13
==
(
unsigned
int
)
-
1
)
&&
PyErr_Occurred
()))
__PYX_ERR
(
0
,
5
88
,
__pyx_L1_error
)
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__pyx_v_sh0
=
__pyx_t_13
;
__pyx_v_sh0
=
__pyx_t_13
;
/* "aesara/scan/scan_perform.pyx":5
93
/* "aesara/scan/scan_perform.pyx":5
89
* # the directive.
* # the directive.
* sh0 = outer_outputs_idx_0.shape[0]
* sh0 = outer_outputs_idx_0.shape[0]
* outer_outputs_idx[0] = outer_outputs_idx_0[:sh0-(n_steps - i)] # <<<<<<<<<<<<<<
* outer_outputs_idx[0] = outer_outputs_idx_0[:sh0-(n_steps - i)] # <<<<<<<<<<<<<<
*
*
* # We never reuse the input or output storage of the
* # We never reuse the input or output storage of the
*/
*/
__pyx_t_3
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
0
,
(
__pyx_v_sh0
-
(
__pyx_v_n_steps
-
__pyx_v_i
)),
NULL
,
NULL
,
NULL
,
0
,
1
,
0
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
5
93
,
__pyx_L1_error
)
__pyx_t_3
=
__Pyx_PyObject_GetSlice
(
__pyx_v_outer_outputs_idx_0
,
0
,
(
__pyx_v_sh0
-
(
__pyx_v_n_steps
-
__pyx_v_i
)),
NULL
,
NULL
,
NULL
,
0
,
1
,
0
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
5
89
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_GOTREF
(
__pyx_t_3
);
if
(
unlikely
(
__Pyx_SetItemInt
(
__pyx_v_outer_outputs_idx
,
0
,
__pyx_t_3
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
)
<
0
))
__PYX_ERR
(
0
,
5
93
,
__pyx_L1_error
)
if
(
unlikely
(
__Pyx_SetItemInt
(
__pyx_v_outer_outputs_idx
,
0
,
__pyx_t_3
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
)
<
0
))
__PYX_ERR
(
0
,
5
89
,
__pyx_L1_error
)
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
/* "aesara/scan/scan_perform.pyx":58
5
/* "aesara/scan/scan_perform.pyx":58
1
* # if optimization gets applied compared to when optimization
* # if optimization gets applied compared to when optimization
* # do not get applied
* # do not get applied
* if i < n_steps: # <<<<<<<<<<<<<<
* if i < n_steps: # <<<<<<<<<<<<<<
...
@@ -7093,7 +7021,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7093,7 +7021,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
*/
*/
}
}
/* "aesara/scan/scan_perform.pyx":57
5
/* "aesara/scan/scan_perform.pyx":57
1
* # expected to return 0 for all entries for which the gradient is
* # expected to return 0 for all entries for which the gradient is
* # not actually computed
* # not actually computed
* elif store_steps_idx > i - mintaps_idx: # <<<<<<<<<<<<<<
* elif store_steps_idx > i - mintaps_idx: # <<<<<<<<<<<<<<
...
@@ -7104,7 +7032,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7104,7 +7032,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
__pyx_L125:
;
__pyx_L125:
;
}
}
/* "aesara/scan/scan_perform.pyx":59
7
/* "aesara/scan/scan_perform.pyx":59
3
* # We never reuse the input or output storage of the
* # We never reuse the input or output storage of the
* # inner function so we clear it.
* # inner function so we clear it.
* for s in inner_input_storage: # <<<<<<<<<<<<<<
* for s in inner_input_storage: # <<<<<<<<<<<<<<
...
@@ -7115,24 +7043,24 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7115,24 +7043,24 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
for
(;;)
{
for
(;;)
{
if
(
__pyx_t_9
>=
PyList_GET_SIZE
(
__pyx_t_3
))
break
;
if
(
__pyx_t_9
>=
PyList_GET_SIZE
(
__pyx_t_3
))
break
;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_
2
=
PyList_GET_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__Pyx_INCREF
(
__pyx_t_2
);
__pyx_t_9
++
;
if
(
unlikely
(
0
<
0
))
__PYX_ERR
(
0
,
597
,
__pyx_L1_error
)
__pyx_t_
1
=
PyList_GET_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__Pyx_INCREF
(
__pyx_t_1
);
__pyx_t_9
++
;
if
(
unlikely
(
0
<
0
))
__PYX_ERR
(
0
,
593
,
__pyx_L1_error
)
#else
#else
__pyx_t_
2
=
PySequence_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__pyx_t_9
++
;
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
597
,
__pyx_L1_error
)
__pyx_t_
1
=
PySequence_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__pyx_t_9
++
;
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
593
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_
2
);
__Pyx_GOTREF
(
__pyx_t_
1
);
#endif
#endif
__Pyx_XDECREF_SET
(
__pyx_v_s
,
__pyx_t_
2
);
__Pyx_XDECREF_SET
(
__pyx_v_s
,
__pyx_t_
1
);
__pyx_t_
2
=
0
;
__pyx_t_
1
=
0
;
/* "aesara/scan/scan_perform.pyx":59
8
/* "aesara/scan/scan_perform.pyx":59
4
* # inner function so we clear it.
* # inner function so we clear it.
* for s in inner_input_storage:
* for s in inner_input_storage:
* s[0] = None # <<<<<<<<<<<<<<
* s[0] = None # <<<<<<<<<<<<<<
* for s in inner_output_storage:
* for s in inner_output_storage:
* s[0] = None
* s[0] = None
*/
*/
if
(
unlikely
(
__Pyx_SetItemInt
(
__pyx_v_s
,
0
,
Py_None
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
)
<
0
))
__PYX_ERR
(
0
,
59
8
,
__pyx_L1_error
)
if
(
unlikely
(
__Pyx_SetItemInt
(
__pyx_v_s
,
0
,
Py_None
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
)
<
0
))
__PYX_ERR
(
0
,
59
4
,
__pyx_L1_error
)
/* "aesara/scan/scan_perform.pyx":59
7
/* "aesara/scan/scan_perform.pyx":59
3
* # We never reuse the input or output storage of the
* # We never reuse the input or output storage of the
* # inner function so we clear it.
* # inner function so we clear it.
* for s in inner_input_storage: # <<<<<<<<<<<<<<
* for s in inner_input_storage: # <<<<<<<<<<<<<<
...
@@ -7142,7 +7070,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7142,7 +7070,7 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
}
}
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
/* "aesara/scan/scan_perform.pyx":59
9
/* "aesara/scan/scan_perform.pyx":59
5
* for s in inner_input_storage:
* for s in inner_input_storage:
* s[0] = None
* s[0] = None
* for s in inner_output_storage: # <<<<<<<<<<<<<<
* for s in inner_output_storage: # <<<<<<<<<<<<<<
...
@@ -7153,24 +7081,24 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7153,24 +7081,24 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
for
(;;)
{
for
(;;)
{
if
(
__pyx_t_9
>=
PyList_GET_SIZE
(
__pyx_t_3
))
break
;
if
(
__pyx_t_9
>=
PyList_GET_SIZE
(
__pyx_t_3
))
break
;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_
2
=
PyList_GET_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__Pyx_INCREF
(
__pyx_t_2
);
__pyx_t_9
++
;
if
(
unlikely
(
0
<
0
))
__PYX_ERR
(
0
,
599
,
__pyx_L1_error
)
__pyx_t_
1
=
PyList_GET_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__Pyx_INCREF
(
__pyx_t_1
);
__pyx_t_9
++
;
if
(
unlikely
(
0
<
0
))
__PYX_ERR
(
0
,
595
,
__pyx_L1_error
)
#else
#else
__pyx_t_
2
=
PySequence_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__pyx_t_9
++
;
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
599
,
__pyx_L1_error
)
__pyx_t_
1
=
PySequence_ITEM
(
__pyx_t_3
,
__pyx_t_9
);
__pyx_t_9
++
;
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
595
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_
2
);
__Pyx_GOTREF
(
__pyx_t_
1
);
#endif
#endif
__Pyx_XDECREF_SET
(
__pyx_v_s
,
__pyx_t_
2
);
__Pyx_XDECREF_SET
(
__pyx_v_s
,
__pyx_t_
1
);
__pyx_t_
2
=
0
;
__pyx_t_
1
=
0
;
/* "aesara/scan/scan_perform.pyx":
600
/* "aesara/scan/scan_perform.pyx":
596
* s[0] = None
* s[0] = None
* for s in inner_output_storage:
* for s in inner_output_storage:
* s[0] = None # <<<<<<<<<<<<<<
* s[0] = None # <<<<<<<<<<<<<<
*
*
* return t_fn, i
* return t_fn, i
*/
*/
if
(
unlikely
(
__Pyx_SetItemInt
(
__pyx_v_s
,
0
,
Py_None
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
)
<
0
))
__PYX_ERR
(
0
,
600
,
__pyx_L1_error
)
if
(
unlikely
(
__Pyx_SetItemInt
(
__pyx_v_s
,
0
,
Py_None
,
long
,
1
,
__Pyx_PyInt_From_long
,
0
,
0
,
0
)
<
0
))
__PYX_ERR
(
0
,
596
,
__pyx_L1_error
)
/* "aesara/scan/scan_perform.pyx":59
9
/* "aesara/scan/scan_perform.pyx":59
5
* for s in inner_input_storage:
* for s in inner_input_storage:
* s[0] = None
* s[0] = None
* for s in inner_output_storage: # <<<<<<<<<<<<<<
* for s in inner_output_storage: # <<<<<<<<<<<<<<
...
@@ -7180,26 +7108,26 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
...
@@ -7180,26 +7108,26 @@ static PyObject *__pyx_pf_6aesara_4scan_12scan_perform_2perform(CYTHON_UNUSED Py
}
}
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
__Pyx_DECREF
(
__pyx_t_3
);
__pyx_t_3
=
0
;
/* "aesara/scan/scan_perform.pyx":
602
/* "aesara/scan/scan_perform.pyx":
598
* s[0] = None
* s[0] = None
*
*
* return t_fn, i # <<<<<<<<<<<<<<
* return t_fn, i # <<<<<<<<<<<<<<
*/
*/
__Pyx_XDECREF
(
__pyx_r
);
__Pyx_XDECREF
(
__pyx_r
);
__pyx_t_3
=
__Pyx_PyInt_From_time_t
(
__pyx_v_t_fn
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
602
,
__pyx_L1_error
)
__pyx_t_3
=
__Pyx_PyInt_From_time_t
(
__pyx_v_t_fn
);
if
(
unlikely
(
!
__pyx_t_3
))
__PYX_ERR
(
0
,
598
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_3
);
__Pyx_GOTREF
(
__pyx_t_3
);
__pyx_t_2
=
__Pyx_PyInt_From_unsigned_int
(
__pyx_v_i
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
602
,
__pyx_L1_error
)
__pyx_t_1
=
__Pyx_PyInt_From_unsigned_int
(
__pyx_v_i
);
if
(
unlikely
(
!
__pyx_t_1
))
__PYX_ERR
(
0
,
598
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_1
);
__pyx_t_2
=
PyTuple_New
(
2
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
598
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_2
);
__Pyx_GOTREF
(
__pyx_t_2
);
__pyx_t_16
=
PyTuple_New
(
2
);
if
(
unlikely
(
!
__pyx_t_16
))
__PYX_ERR
(
0
,
602
,
__pyx_L1_error
)
__Pyx_GOTREF
(
__pyx_t_16
);
__Pyx_GIVEREF
(
__pyx_t_3
);
__Pyx_GIVEREF
(
__pyx_t_3
);
PyTuple_SET_ITEM
(
__pyx_t_
16
,
0
,
__pyx_t_3
);
PyTuple_SET_ITEM
(
__pyx_t_
2
,
0
,
__pyx_t_3
);
__Pyx_GIVEREF
(
__pyx_t_
2
);
__Pyx_GIVEREF
(
__pyx_t_
1
);
PyTuple_SET_ITEM
(
__pyx_t_
16
,
1
,
__pyx_t_2
);
PyTuple_SET_ITEM
(
__pyx_t_
2
,
1
,
__pyx_t_1
);
__pyx_t_3
=
0
;
__pyx_t_3
=
0
;
__pyx_t_1
=
0
;
__pyx_r
=
__pyx_t_2
;
__pyx_t_2
=
0
;
__pyx_t_2
=
0
;
__pyx_r
=
__pyx_t_16
;
__pyx_t_16
=
0
;
goto
__pyx_L0
;
goto
__pyx_L0
;
/* "aesara/scan/scan_perform.pyx":76
/* "aesara/scan/scan_perform.pyx":76
...
@@ -22535,7 +22463,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
...
@@ -22535,7 +22463,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
*
*
*
*
* def get_version(): # <<<<<<<<<<<<<<
* def get_version(): # <<<<<<<<<<<<<<
* return 0.32
3
* return 0.32
4
*
*
*/
*/
__pyx_codeobj__24
=
(
PyObject
*
)
__Pyx_PyCode_New
(
0
,
0
,
0
,
0
,
CO_OPTIMIZED
|
CO_NEWLOCALS
,
__pyx_empty_bytes
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_kp_s_scan_perform_pyx
,
__pyx_n_s_get_version
,
64
,
__pyx_empty_bytes
);
if
(
unlikely
(
!
__pyx_codeobj__24
))
__PYX_ERR
(
0
,
64
,
__pyx_L1_error
)
__pyx_codeobj__24
=
(
PyObject
*
)
__Pyx_PyCode_New
(
0
,
0
,
0
,
0
,
CO_OPTIMIZED
|
CO_NEWLOCALS
,
__pyx_empty_bytes
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_empty_tuple
,
__pyx_kp_s_scan_perform_pyx
,
__pyx_n_s_get_version
,
64
,
__pyx_empty_bytes
);
if
(
unlikely
(
!
__pyx_codeobj__24
))
__PYX_ERR
(
0
,
64
,
__pyx_L1_error
)
...
@@ -22626,7 +22554,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
...
@@ -22626,7 +22554,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
static
CYTHON_SMALL_CODE
int
__Pyx_InitGlobals
(
void
)
{
static
CYTHON_SMALL_CODE
int
__Pyx_InitGlobals
(
void
)
{
if
(
__Pyx_InitStrings
(
__pyx_string_tab
)
<
0
)
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
);
if
(
__Pyx_InitStrings
(
__pyx_string_tab
)
<
0
)
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
);
__pyx_float_0_0
=
PyFloat_FromDouble
(
0
.
0
);
if
(
unlikely
(
!
__pyx_float_0_0
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_float_0_0
=
PyFloat_FromDouble
(
0
.
0
);
if
(
unlikely
(
!
__pyx_float_0_0
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_float_0_32
3
=
PyFloat_FromDouble
(
0
.
323
);
if
(
unlikely
(
!
__pyx_float_0_323
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_float_0_32
4
=
PyFloat_FromDouble
(
0
.
324
);
if
(
unlikely
(
!
__pyx_float_0_324
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_int_0
=
PyInt_FromLong
(
0
);
if
(
unlikely
(
!
__pyx_int_0
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_int_0
=
PyInt_FromLong
(
0
);
if
(
unlikely
(
!
__pyx_int_0
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_int_1
=
PyInt_FromLong
(
1
);
if
(
unlikely
(
!
__pyx_int_1
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_int_1
=
PyInt_FromLong
(
1
);
if
(
unlikely
(
!
__pyx_int_1
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_int_184977713
=
PyInt_FromLong
(
184977713L
);
if
(
unlikely
(
!
__pyx_int_184977713
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
__pyx_int_184977713
=
PyInt_FromLong
(
184977713L
);
if
(
unlikely
(
!
__pyx_int_184977713
))
__PYX_ERR
(
0
,
1
,
__pyx_L1_error
)
...
@@ -23075,7 +23003,7 @@ if (!__Pyx_RefNanny) {
...
@@ -23075,7 +23003,7 @@ if (!__Pyx_RefNanny) {
*
*
*
*
* def get_version(): # <<<<<<<<<<<<<<
* def get_version(): # <<<<<<<<<<<<<<
* return 0.32
3
* return 0.32
4
*
*
*/
*/
__pyx_t_2
=
PyCFunction_NewEx
(
&
__pyx_mdef_6aesara_4scan_12scan_perform_1get_version
,
NULL
,
__pyx_n_s_aesara_scan_scan_perform
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
64
,
__pyx_L1_error
)
__pyx_t_2
=
PyCFunction_NewEx
(
&
__pyx_mdef_6aesara_4scan_12scan_perform_1get_version
,
NULL
,
__pyx_n_s_aesara_scan_scan_perform
);
if
(
unlikely
(
!
__pyx_t_2
))
__PYX_ERR
(
0
,
64
,
__pyx_L1_error
)
aesara/scan/scan_perform.pyx
浏览文件 @
77c7836e
...
@@ -62,7 +62,7 @@ numpy.import_array()
...
@@ -62,7 +62,7 @@ numpy.import_array()
def get_version():
def get_version():
return 0.32
3
return 0.32
4
@cython.cdivision(True)
@cython.cdivision(True)
...
@@ -556,15 +556,11 @@ def perform(
...
@@ -556,15 +556,11 @@ def perform(
# are read and written.
# are read and written.
# This way, there will be no information overwritten
# This way, there will be no information overwritten
# before it is read (as it used to happen).
# before it is read (as it used to happen).
shape = (pdx,)+ outer_outputs_idx_0.shape[1:]
tmp = outer_outputs_idx_0[:pdx].copy()
tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
tmp[:] = outer_outputs_idx_0[:pdx]
outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:]
outer_outputs_idx_0[:store_steps_idx - pdx] = outer_outputs_idx_0[pdx:]
outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
outer_outputs_idx_0[store_steps_idx - pdx:] = tmp
else:
else:
shape = (store_steps_idx - pdx,) + outer_outputs_idx_0.shape[1:]
tmp = outer_outputs_idx_0[pdx:].copy()
tmp = numpy.empty(shape, dtype=outer_output_dtypes[idx])
tmp[:] = outer_outputs_idx_0[pdx:]
outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx]
outer_outputs_idx_0[store_steps_idx - pdx:] = outer_outputs_idx_0[:pdx]
outer_outputs_idx_0[:store_steps_idx - pdx] = tmp
outer_outputs_idx_0[:store_steps_idx - pdx] = tmp
...
...
aesara/scan/scan_perform_ext.py
浏览文件 @
77c7836e
...
@@ -23,7 +23,7 @@ if not config.cxx:
...
@@ -23,7 +23,7 @@ if not config.cxx:
_logger
=
logging
.
getLogger
(
"aesara.scan.scan_perform"
)
_logger
=
logging
.
getLogger
(
"aesara.scan.scan_perform"
)
version
=
0.32
3
# must match constant returned in function get_version()
version
=
0.32
4
# must match constant returned in function get_version()
need_reload
=
False
need_reload
=
False
scan_perform
:
Optional
[
ModuleType
]
=
None
scan_perform
:
Optional
[
ModuleType
]
=
None
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论