hello_world.ino loop
1
2
3
4
5
if (op_type == CONV2D) {
Convolution2d(conv_size, input, output, weights);
} else if (op_type == FULLY_CONNECTED) {
FullyConnected(input, output, weights);
}
1
2
3
4
5
6
7
8
model = tflite::GetModel(g_model);
if (model->version() != TFLITE_SCHEMA_VERSION) {
TF_LITE_REPORT_ERROR(error_reporter,
"Model provided is schema version %d not equal "
"to supported version %d.",
model->version(), TFLITE_SCHEMA_VERSION);
return;
}
hello_world: g_model is declared in model.cpp g_model is originally a data structure.
malloc and new.malloc or new.hello_world: global namespace declaration
1
2
constexpr int kTensorArenaSize = 2000;
uint8_t tensor_arena[kTensorArenaSize];
arena_used_bytes() to get the actual size used.
1
static tflite::AllOpsResolver resolver;