template <typename Dtype> | |
void printMat(const Dtype* data, int rows, int cols) { | |
int j = 0; | |
std::cout<<"np.array(["; | |
for (int r=0; r<rows; r++) { | |
std::cout<<"["; | |
for (int c=0; c<cols; c++) { | |
std::cout<<data[j++]; | |
if (c<cols-1) std::cout<<","; | |
} | |
std::cout<<"]"; | |
if (r<rows-1) std::cout<<","; | |
} | |
std::cout<<"])"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment