# HG changeset patch # User Frederic Bastien # Date 1257259854 18000 # Node ID d15683416ebf78895f5b1a90e74059de6c200d8e # Parent ab7d598f55795b6faa55f49a3f8b9ef75b97cf4a some fix to the c code of FillMissing. It was not compiling. diff -r ab7d598f5579 -r d15683416ebf pylearn/sandbox/scan_inputs_groups.py --- a/pylearn/sandbox/scan_inputs_groups.py Mon Oct 26 16:33:16 2009 -0400 +++ b/pylearn/sandbox/scan_inputs_groups.py Tue Nov 03 09:50:54 2009 -0500 @@ -691,7 +691,7 @@ ] def c_headers(self): - return ['"Python.h"', '"numpy/noprefix.h"', ''] + return ['"Python.h"', '"numpy/noprefix.h"', '', ''] def c_support_code(self): return """ @@ -776,7 +776,12 @@ } } -assert(input->nd==value->nd==mask->nd); +if(input->nd!=value->nd || input->nd!=mask->nd){ + PyErr_Format(PyExc_ValueError, + "FillMissing input have %%d dims, the mask have %%d dims and the value have %%d dims. They should all be equals \\n", + input->nd, value->nd, mask->nd); + %(fail)s; +} #if %(self.fill_with_is_array)s if(input->nd==1){ %(type)s* value_ = (%(type)s*)(value->data); @@ -809,7 +814,7 @@ } }else{//not implemented! //SHOULD not happen as c_code should revert to the python version in that case - std:stringstream temp; + std::stringstream temp; temp << "In FillMissing, we try to fill with an array and the input ndim is implemented only for 1 and 2. This case is not implemented."<