XiaoMi / nnlib

Fork of https://source.codeaurora.org/quic/hexagon_nn/nnlib
BSD 3-Clause Clear License
54 stars 11 forks source link

To where PPrint op outputs the result #10

Closed apivovarov closed 4 years ago

apivovarov commented 4 years ago

I'm running hexagon_nn example 004-xor-graph.c. It uses three PPrint_f operators. But I do not see that it dumps tensors content to terminal or to logcat. To where PPrint_f outputs tensor content? Anyone tried to use it?

//                  ACTUAL GRAPH
//         [ 1,-1]                 [1]
//         [-1, 1]                 [1]
//         "layer1a"            "layer3a"
//          0x1001a              0x1003a
//               \                   \.
//   [1,0] -----> MatMul --> Relu --> MatMul ----.
//   Const       "layer1"  "layer2"  "layer3"     \.
//  0x1001b       0x1001    0x1002    0x1003       \.
//                     \         \         \        \.
//                      PPrint    PPrint    PPrint   Close
//                      0x2000    0x2001    0x2002   0x2003
//                                                   /
//                                                  /
//                                                [1]
//                                               Const
//                                              0x2003a
apivovarov commented 4 years ago

ok, I got it. I need to use hexagon_nn_getlog

unsigned char buff[10001];
hexagon_nn_getlog(graph_id, &(buff[0]), 10000);
printf("hexagon_nn_getlog %s\n", buff);