Last active
February 3, 2016 17:26
-
-
Save kashefy/1120e33ff8067b268dca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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