|
|
|
@ -1,13 +1,15 @@
|
|
|
|
|
#include <paddle/capi.h>
|
|
|
|
|
#include <time.h>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "../common/common.h"
|
|
|
|
|
|
|
|
|
|
#define CONFIG_BIN "./trainer_config.bin"
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
// Initalize Paddle
|
|
|
|
|
char* argv[] = {"--use_gpu=False"};
|
|
|
|
|
CHECK(paddle_init(1, (char**)argv));
|
|
|
|
|
std::string comand[] = {"--use_gpu=False"};
|
|
|
|
|
CHECK(paddle_init(1, (char**)comand));
|
|
|
|
|
|
|
|
|
|
// Reading config binary file. It is generated by `convert_protobin.sh`
|
|
|
|
|
long size;
|
|
|
|
@ -53,17 +55,20 @@ int main() {
|
|
|
|
|
|
|
|
|
|
CHECK(paddle_arguments_get_value(out_args, 0, prob));
|
|
|
|
|
|
|
|
|
|
std::std::vector<paddle_real> result;
|
|
|
|
|
int height;
|
|
|
|
|
int width;
|
|
|
|
|
std::vector<paddle_real> result;
|
|
|
|
|
uint64_t height;
|
|
|
|
|
uint64_t width;
|
|
|
|
|
|
|
|
|
|
CHECK(paddle_matrix_get_shape(prob, &height, &width);
|
|
|
|
|
CHECK(paddle_matrix_get_shape(prob, &height, &width));
|
|
|
|
|
result.resize(height * width);
|
|
|
|
|
CHECK(paddle_matrix_get_value(prob, result.data()));
|
|
|
|
|
|
|
|
|
|
printf("Prob: ");
|
|
|
|
|
printf("Prob: \n");
|
|
|
|
|
for (int i = 0; i < height * width; ++i) {
|
|
|
|
|
printf("%.2f ", result[i]);
|
|
|
|
|
printf("%.4f ", result[i]);
|
|
|
|
|
if ((i + 1) % width == 0){
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("\n");
|
|
|
|
|
|