提交 9b3c1bfe authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Re-sync scan_perform.c.txt after changes to the cython code

As before, I would suggest reviewing just the cython code and not the C code since is generated, and hence hard to impossible to review.
上级 f03830f8
/* Generated by Cython 0.14 on Thu Aug 11 10:50:43 2011 */ /* Generated by Cython 0.14 on Thu Aug 11 12:24:06 2011 */
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
#include "Python.h" #include "Python.h"
...@@ -1013,7 +1013,7 @@ static PyObject *__pyx_k_tuple_15; ...@@ -1013,7 +1013,7 @@ static PyObject *__pyx_k_tuple_15;
* *
* *
* def get_version(): # <<<<<<<<<<<<<< * def get_version(): # <<<<<<<<<<<<<<
* return 0.25 * return 0.265
* *
*/ */
...@@ -1028,12 +1028,12 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_0get_version(PyOb ...@@ -1028,12 +1028,12 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_0get_version(PyOb
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":66 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":66
* *
* def get_version(): * def get_version():
* return 0.25 # <<<<<<<<<<<<<< * return 0.265 # <<<<<<<<<<<<<<
* *
* @cython.boundscheck(False) * @cython.boundscheck(False)
*/ */
__Pyx_XDECREF(__pyx_r); __Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyFloat_FromDouble(0.25); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyFloat_FromDouble(0.265); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1; __pyx_r = __pyx_t_1;
__pyx_t_1 = 0; __pyx_t_1 = 0;
...@@ -1121,6 +1121,7 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -1121,6 +1121,7 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
PyObject *__pyx_v_shape; PyObject *__pyx_v_shape;
PyObject *__pyx_v_dtype; PyObject *__pyx_v_dtype;
PyObject *__pyx_v_tmp; PyObject *__pyx_v_tmp;
PyObject *__pyx_v_sh0;
PyObject *__pyx_v_t_call; PyObject *__pyx_v_t_call;
PyObject *__pyx_v_profile; PyObject *__pyx_v_profile;
Py_buffer __pyx_bstruct_tap_array_len; Py_buffer __pyx_bstruct_tap_array_len;
...@@ -1420,6 +1421,7 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -1420,6 +1421,7 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
__pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_dtype = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dtype = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_tmp = Py_None; __Pyx_INCREF(Py_None); __pyx_v_tmp = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_sh0 = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_t_call = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t_call = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_profile = Py_None; __Pyx_INCREF(Py_None); __pyx_v_profile = Py_None; __Pyx_INCREF(Py_None);
__pyx_bstruct_mintaps.buf = NULL; __pyx_bstruct_mintaps.buf = NULL;
...@@ -4533,8 +4535,8 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -4533,8 +4535,8 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
* # 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: # <<<<<<<<<<<<<<
* outs[idx][0] = outs[idx][0][:-(n_steps - i)] * sh0 = outs[idx][0].shape[0]
* * outs[idx][0] = outs[idx][0][:sh0-(n_steps - i)]
*/ */
__pyx_t_3 = (__pyx_v_i < __pyx_v_n_steps); __pyx_t_3 = (__pyx_v_i < __pyx_v_n_steps);
if (__pyx_t_3) { if (__pyx_t_3) {
...@@ -4542,23 +4544,52 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -4542,23 +4544,52 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":458 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":458
* # do not get applied * # do not get applied
* if i < n_steps: * if i < n_steps:
* outs[idx][0] = outs[idx][0][:-(n_steps - i)] # <<<<<<<<<<<<<< * sh0 = outs[idx][0].shape[0] # <<<<<<<<<<<<<<
* outs[idx][0] = outs[idx][0][:sh0-(n_steps - i)]
* *
* t_call = time.time() - t0_call
*/ */
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_outs, __pyx_v_idx, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_outs, __pyx_v_idx, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PySequence_GetSlice(__pyx_t_1, 0, (-(__pyx_v_n_steps - __pyx_v_i))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_v_sh0);
__pyx_v_sh0 = __pyx_t_1;
__pyx_t_1 = 0;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":459
* if i < n_steps:
* sh0 = outs[idx][0].shape[0]
* outs[idx][0] = outs[idx][0][:sh0-(n_steps - i)] # <<<<<<<<<<<<<<
*
* t_call = time.time() - t0_call
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_outs, __pyx_v_idx, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_outs, __pyx_v_idx, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyLong_FromUnsignedLong((__pyx_v_n_steps - __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
if (__Pyx_SetItemInt(__pyx_t_1, 0, __pyx_t_7, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyNumber_Subtract(__pyx_v_sh0, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_t_7, 0, __pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_outs, __pyx_v_idx, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_SetItemInt(__pyx_t_7, 0, __pyx_t_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L90; goto __pyx_L90;
} }
__pyx_L90:; __pyx_L90:;
...@@ -4567,58 +4598,58 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -4567,58 +4598,58 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
__pyx_L86:; __pyx_L86:;
} }
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":460 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":461
* outs[idx][0] = outs[idx][0][:-(n_steps - i)] * outs[idx][0] = outs[idx][0][:sh0-(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'):
*/ */
__pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__time); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_v_t0_call); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_v_t0_call); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_v_t_call); __Pyx_DECREF(__pyx_v_t_call);
__pyx_v_t_call = __pyx_t_1; __pyx_v_t_call = __pyx_t_7;
__pyx_t_1 = 0; __pyx_t_7 = 0;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":462 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":463
* t_call = time.time() - t0_call * t_call = time.time() - t0_call
* *
* if hasattr(fnct.maker, 'profile'): # <<<<<<<<<<<<<< * if hasattr(fnct.maker, 'profile'): # <<<<<<<<<<<<<<
* profile = fnct.maker.profile * profile = fnct.maker.profile
* if type(profile) is not bool and profile: * if type(profile) is not bool and profile:
*/ */
__pyx_t_1 = PyObject_GetAttr(__pyx_v_fnct, __pyx_n_s__maker); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = PyObject_GetAttr(__pyx_v_fnct, __pyx_n_s__maker); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7);
__pyx_t_3 = PyObject_HasAttr(__pyx_t_1, ((PyObject *)__pyx_n_s__profile)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = PyObject_HasAttr(__pyx_t_7, ((PyObject *)__pyx_n_s__profile)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_3) { if (__pyx_t_3) {
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":463 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":464
* *
* if hasattr(fnct.maker, 'profile'): * if hasattr(fnct.maker, 'profile'):
* profile = fnct.maker.profile # <<<<<<<<<<<<<< * profile = fnct.maker.profile # <<<<<<<<<<<<<<
* if type(profile) is not bool and profile: * if type(profile) is not bool and profile:
* profile.vm_call_time += t_fn * profile.vm_call_time += t_fn
*/ */
__pyx_t_1 = PyObject_GetAttr(__pyx_v_fnct, __pyx_n_s__maker); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = PyObject_GetAttr(__pyx_v_fnct, __pyx_n_s__maker); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__profile); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__profile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_v_profile); __Pyx_DECREF(__pyx_v_profile);
__pyx_v_profile = __pyx_t_7; __pyx_v_profile = __pyx_t_2;
__pyx_t_7 = 0; __pyx_t_2 = 0;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":464 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":465
* if hasattr(fnct.maker, 'profile'): * if hasattr(fnct.maker, 'profile'):
* profile = fnct.maker.profile * profile = fnct.maker.profile
* if type(profile) is not bool and profile: # <<<<<<<<<<<<<< * if type(profile) is not bool and profile: # <<<<<<<<<<<<<<
...@@ -4627,105 +4658,105 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -4627,105 +4658,105 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
*/ */
__pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_profile)) != ((PyObject*)&PyBool_Type)); __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_profile)) != ((PyObject*)&PyBool_Type));
if (__pyx_t_3) { if (__pyx_t_3) {
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_profile); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_profile); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_36 = __pyx_t_13; __pyx_t_36 = __pyx_t_13;
} else { } else {
__pyx_t_36 = __pyx_t_3; __pyx_t_36 = __pyx_t_3;
} }
if (__pyx_t_36) { if (__pyx_t_36) {
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":465 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":466
* profile = fnct.maker.profile * profile = fnct.maker.profile
* if type(profile) is not bool and profile: * if type(profile) is not bool and profile:
* profile.vm_call_time += t_fn # <<<<<<<<<<<<<< * profile.vm_call_time += t_fn # <<<<<<<<<<<<<<
* profile.callcount += 1 * profile.callcount += 1
* profile.nbsteps += n_steps * profile.nbsteps += n_steps
*/ */
__pyx_t_7 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__vm_call_time); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__vm_call_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_t_fn); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_v_t_fn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__vm_call_time, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__vm_call_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":466 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":467
* if type(profile) is not bool and profile: * if type(profile) is not bool and profile:
* profile.vm_call_time += t_fn * profile.vm_call_time += t_fn
* profile.callcount += 1 # <<<<<<<<<<<<<< * profile.callcount += 1 # <<<<<<<<<<<<<<
* profile.nbsteps += n_steps * profile.nbsteps += n_steps
* profile.call_time += t_call * profile.call_time += t_call
*/ */
__pyx_t_1 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__callcount); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__callcount); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__callcount, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__callcount, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":467 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":468
* profile.vm_call_time += t_fn * profile.vm_call_time += t_fn
* profile.callcount += 1 * profile.callcount += 1
* profile.nbsteps += n_steps # <<<<<<<<<<<<<< * profile.nbsteps += n_steps # <<<<<<<<<<<<<<
* profile.call_time += t_call * profile.call_time += t_call
* if hasattr(fn, 'update_profile'): * if hasattr(fn, 'update_profile'):
*/ */
__pyx_t_7 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__nbsteps); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__nbsteps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = PyInt_FromLong(__pyx_v_n_steps); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = PyInt_FromLong(__pyx_v_n_steps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__nbsteps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__nbsteps, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":468 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":469
* profile.callcount += 1 * profile.callcount += 1
* profile.nbsteps += n_steps * profile.nbsteps += n_steps
* profile.call_time += t_call # <<<<<<<<<<<<<< * profile.call_time += t_call # <<<<<<<<<<<<<<
* if hasattr(fn, 'update_profile'): * if hasattr(fn, 'update_profile'):
* fn.update_profile(profile) * fn.update_profile(profile)
*/ */
__pyx_t_2 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__call_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyObject_GetAttr(__pyx_v_profile, __pyx_n_s__call_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_t_call); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_t_call); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__call_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyObject_SetAttr(__pyx_v_profile, __pyx_n_s__call_time, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":469 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":470
* profile.nbsteps += n_steps * profile.nbsteps += n_steps
* profile.call_time += t_call * profile.call_time += t_call
* if hasattr(fn, 'update_profile'): # <<<<<<<<<<<<<< * if hasattr(fn, 'update_profile'): # <<<<<<<<<<<<<<
* fn.update_profile(profile) * fn.update_profile(profile)
* *
*/ */
__pyx_t_36 = PyObject_HasAttr(__pyx_v_fn, ((PyObject *)__pyx_n_s__update_profile)); if (unlikely(__pyx_t_36 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_36 = PyObject_HasAttr(__pyx_v_fn, ((PyObject *)__pyx_n_s__update_profile)); if (unlikely(__pyx_t_36 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_36) { if (__pyx_t_36) {
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":470 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":471
* profile.call_time += t_call * profile.call_time += t_call
* if hasattr(fn, 'update_profile'): * if hasattr(fn, 'update_profile'):
* fn.update_profile(profile) # <<<<<<<<<<<<<< * fn.update_profile(profile) # <<<<<<<<<<<<<<
* *
* ### Old Profile Mode * ### Old Profile Mode
*/ */
__pyx_t_1 = PyObject_GetAttr(__pyx_v_fn, __pyx_n_s__update_profile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = PyObject_GetAttr(__pyx_v_fn, __pyx_n_s__update_profile); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_INCREF(__pyx_v_profile); __Pyx_INCREF(__pyx_v_profile);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_profile); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_profile);
__Pyx_GIVEREF(__pyx_v_profile); __Pyx_GIVEREF(__pyx_v_profile);
__pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L93; goto __pyx_L93;
} }
__pyx_L93:; __pyx_L93:;
...@@ -4736,23 +4767,23 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -4736,23 +4767,23 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
} }
__pyx_L91:; __pyx_L91:;
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":481 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":482
* *
* # DEBUG PRINT : * # DEBUG PRINT :
* self.t_call = t_call # <<<<<<<<<<<<<< * self.t_call = t_call # <<<<<<<<<<<<<<
* self.t_fn = t_fn * self.t_fn = t_fn
* # print 'Cython > timing', t_call, t_fn, 'in percentage', 100.*t_fn/t_call * # print 'Cython > timing', t_call, t_fn, 'in percentage', 100.*t_fn/t_call
*/ */
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__t_call, __pyx_v_t_call) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__t_call, __pyx_v_t_call) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":482 /* "/u/pascanur/repos/Theano.versions/Theano_clean/theano/scan_module/scan_perform.pyx":483
* # DEBUG PRINT : * # DEBUG PRINT :
* self.t_call = t_call * self.t_call = t_call
* self.t_fn = t_fn # <<<<<<<<<<<<<< * self.t_fn = t_fn # <<<<<<<<<<<<<<
* # print 'Cython > timing', t_call, t_fn, 'in percentage', 100.*t_fn/t_call * # print 'Cython > timing', t_call, t_fn, 'in percentage', 100.*t_fn/t_call
* *
*/ */
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__t_fn, __pyx_v_t_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__t_fn, __pyx_v_t_fn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0; goto __pyx_L0;
...@@ -4796,6 +4827,7 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject ...@@ -4796,6 +4827,7 @@ static PyObject *__pyx_pf_6theano_11scan_module_12scan_perform_1perform(PyObject
__Pyx_DECREF(__pyx_v_shape); __Pyx_DECREF(__pyx_v_shape);
__Pyx_DECREF(__pyx_v_dtype); __Pyx_DECREF(__pyx_v_dtype);
__Pyx_DECREF(__pyx_v_tmp); __Pyx_DECREF(__pyx_v_tmp);
__Pyx_DECREF(__pyx_v_sh0);
__Pyx_DECREF(__pyx_v_t_call); __Pyx_DECREF(__pyx_v_t_call);
__Pyx_DECREF(__pyx_v_profile); __Pyx_DECREF(__pyx_v_profile);
__Pyx_XGIVEREF(__pyx_r); __Pyx_XGIVEREF(__pyx_r);
...@@ -7117,7 +7149,7 @@ PyMODINIT_FUNC PyInit_scan_perform(void) ...@@ -7117,7 +7149,7 @@ PyMODINIT_FUNC PyInit_scan_perform(void)
* *
* *
* def get_version(): # <<<<<<<<<<<<<< * def get_version(): # <<<<<<<<<<<<<<
* return 0.25 * return 0.265
* *
*/ */
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6theano_11scan_module_12scan_perform_0get_version, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6theano_11scan_module_12scan_perform_0get_version, NULL, __pyx_n_s_21); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论