Skip to content

File ns_model.cc

FileList > neuralSPOT > neuralspot > ns-model > src > ns_model.cc

Go to the source code of this file

  • #include "ns_model.h"
  • #include "ns_ambiqsuite_harness.h"
  • #include "ns_debug_log.h"
  • #include "tensorflow/lite/micro/kernels/micro_ops.h"
  • #include "tensorflow/lite/micro/micro_interpreter.h"
  • #include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
  • #include "tensorflow/lite/micro/micro_profiler.h"
  • #include "tensorflow/lite/micro/system_setup.h"
  • #include "tensorflow/lite/schema/schema_generated.h"
  • #include "tensorflow/lite/micro/micro_error_reporter.h"

Public Functions

Type Name
int ns_model_init (ns_model_state_t * ms)
Initialize the model.
TfLiteTensor * ns_tf_get_input_tensor (ns_model_state_t * ms, uint32_t index)
uint32_t ns_tf_get_num_input_tensors (ns_model_state_t * ms)
uint32_t ns_tf_get_num_output_tensors (ns_model_state_t * ms)
TfLiteTensor * ns_tf_get_output_tensor (ns_model_state_t * ms, uint32_t index)

Public Functions Documentation

function ns_model_init

Initialize the model.

int ns_model_init (
    ns_model_state_t * ms
) 

Parameters:

  • ms Model state and configuration struct

Returns:

int status

Initialize the model.

This code is fairly common across most TF-based models. The major differences relate to input and output tensor handling.

function ns_tf_get_input_tensor

TfLiteTensor * ns_tf_get_input_tensor (
    ns_model_state_t * ms,
    uint32_t index
) 

function ns_tf_get_num_input_tensors

uint32_t ns_tf_get_num_input_tensors (
    ns_model_state_t * ms
) 

function ns_tf_get_num_output_tensors

uint32_t ns_tf_get_num_output_tensors (
    ns_model_state_t * ms
) 

function ns_tf_get_output_tensor

TfLiteTensor * ns_tf_get_output_tensor (
    ns_model_state_t * ms,
    uint32_t index
) 

The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-model/src/ns_model.cc