remove Vectorize, simplify to just numpy.squeeze

release/4.3a0
Duy-Nguyen Ta 2017-03-10 23:33:14 -05:00
parent 89bc31d703
commit 0e278f81c6
2 changed files with 1 additions and 7 deletions

View File

@ -420,12 +420,6 @@ void Module::emit_cython_pyx(FileWriter& pyxFile) const {
"from libcpp.pair cimport pair\n"
"from libcpp.string cimport string\n"
"from cython.operator cimport dereference as deref\n\n\n";
pyxFile.oss <<
R"rawstr(def Vectorize(*args):
ret = npp.squeeze(npp.asarray(args, dtype='float'))
if ret.ndim == 0: ret = npp.expand_dims(ret, axis=0)
return ret
)rawstr";
// all classes include all forward declarations
std::vector<Class> allClasses = expandedClasses;

View File

@ -94,7 +94,7 @@ std::string ReturnType::pyx_casting(const std::string& var,
if (isEigen()) {
string s = "ndarray_copy(" + var + ")";
if (pyxClassName() == "Vector")
return "Vectorize(" + s + ")";
return s + ".squeeze()";
else return s;
}
else if (isNonBasicType()) {