The vc++ compiler doesn't automatically promote ints to a floating point type (like gcc) when calling functions like sqrt and log, so you have to cast them explicitly (to a float, double, or long double) to avoid ambiguous call errors. This is handled more elegantly in the original cuda-convnet, where matrix.h declares the functions double sqrt(int _X) and double log(int _X) if the compiler outputs code for windows (via ifdef _WIN32).

The functions are implemented in matrix.cpp and they just cast the int to a double. But, as matrix.h isn't included by nvmatrix.cuh in the pylearn version, this behaviour has changed.