提交 4bc95151 authored 作者: --global's avatar --global

Adapt Cython backend for mitmot prealloc

上级 589c9967
@@ -5808,7 +5808,7 @@
@@ -6667,7 +6667,7 @@
* cdef list stack
* cdef int offset
*/
- __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
+ __pyx_t_4 = ((PyObject *)PyArray_DESCR(__pyx_v_self));
__Pyx_INCREF(__pyx_t_4);
__pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
__pyx_t_4 = 0;
@@ -7337,7 +7337,7 @@
- __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+ __pyx_t_3 = ((PyObject *)PyArray_DESCR(__pyx_v_self));
__Pyx_INCREF(__pyx_t_3);
__pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
__pyx_t_3 = 0;
@@ -8237,7 +8237,7 @@
* arr.base = baseptr
*
*
*/
- Py_XDECREF(__pyx_v_arr->base);
+ Py_XDECREF(PyArray_BASE(__pyx_v_arr));
/* "numpy.pxd":973
* baseptr = <PyObject*>base
@@ -7346,7 +7346,11 @@
*
@@ -8246,7 +8246,11 @@
*
* cdef inline object get_array_base(ndarray arr):
*/
- __pyx_v_arr->base = __pyx_v_baseptr;
......@@ -26,19 +26,19 @@
+ #else
+ PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_baseptr);
+ #endif
__Pyx_RefNannyFinishContext();
}
@@ -7376,7 +7376,7 @@
@@ -8285,7 +8285,7 @@
* return None
* else:
*/
- __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
+ __pyx_t_1 = ((PyArray_BASE(__pyx_v_arr) == NULL) != 0);
if (__pyx_t_1) {
/* "numpy.pxd":977
@@ -7400,8 +7404,8 @@
@@ -8307,8 +8311,8 @@
* return <object>arr.base # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
......
......@@ -879,6 +879,8 @@ class Scan(PureOp):
dtype='int32')
cython_vector_outs = numpy.asarray(self.vector_outs,
dtype='int32')
cython_mitmots_preallocated = numpy.asarray(self.mitmots_preallocated,
dtype='int32')
if hasattr(self, 'destroy_map'):
cython_destroy_map = [x in self.destroy_map
......@@ -906,6 +908,7 @@ class Scan(PureOp):
cython_vector_outs,
cython_mit_mot_out_slices,
cython_mit_mot_out_nslices,
cython_mitmots_preallocated,
self.fn.fn,
self.fn,
cython_destroy_map,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论