未验证 提交 f4742483 编写于 作者: S Steven Toribio 提交者: GitHub

Migrate typedef struct {} name -> struct name {} in TFLM (#1311)

Co-authored-by: Nmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
上级 dfaeaf54
......@@ -49,7 +49,7 @@ enum class BroadcastableOpCategory : uint8_t {
};
#endif
typedef struct {
struct ArithmeticParams_ceva {
// Shape dependent / common to data / op types.
uint8_t broadcast_category; // BroadcastableOpCategory broadcast_category;
// uint8_t inference params.
......@@ -81,7 +81,7 @@ typedef struct {
// broadcast_shape[1] = a3; b3 = 1.
// broadcast_shape[0] = b4 = a4.
int broadcast_shape[5];
} ArithmeticParams_ceva;
};
struct SoftmaxParams_ceva {
// beta is not really used (not a Tensorflow parameter) and not implemented
......@@ -122,7 +122,7 @@ struct PaddingValues_ceva {
int16_t height_offset;
};
typedef struct {
struct StridedSliceParams_ceva {
int8_t start_indices_count;
int32_t start_indices[5];
int8_t stop_indices_count;
......@@ -135,7 +135,7 @@ typedef struct {
int16_t end_mask;
int16_t new_axis_mask;
int16_t shrink_axis_mask;
} StridedSliceParams_ceva;
};
struct PoolParams_ceva {
FusedActivationFunctionType_ceva activation;
......
......@@ -24,7 +24,7 @@ namespace testing {
// kernel is reconciled with reference kernel
#if !defined(XTENSA)
typedef struct LstmIntegerTestConfig {
struct LstmIntegerTestConfig {
const int n_batch;
const int n_input;
const int n_cell;
......@@ -100,9 +100,9 @@ typedef struct LstmIntegerTestConfig {
bool asymmetric_quantize_inputs;
const float ranges[25][2];
} LstmIntegerTestConfig;
};
typedef struct LstmFloatTestConfig {
struct LstmFloatTestConfig {
const int n_batch;
const int n_input;
const int n_cell;
......@@ -153,9 +153,9 @@ typedef struct LstmFloatTestConfig {
float* output;
const float* expected_output_original;
float* expected_output;
} LstmFloatTestConfig;
};
typedef struct LstmWeightQuantizationBuffers {
struct LstmWeightQuantizationBuffers {
int8_t* lstm_i2i_quant;
float* lstm_i2i_scale;
int* lstm_i2i_zp;
......@@ -215,7 +215,7 @@ typedef struct LstmWeightQuantizationBuffers {
float* lstm_proj_w_scale;
int* lstm_proj_w_zp;
TfLiteAffineQuantization* lstm_proj_w_qparam;
} LstmWeightQuantizationBuffers;
};
extern LstmIntegerTestConfig lstm_integer_no_peephole_config;
......
......@@ -54,7 +54,7 @@ TfLiteStatus InitializeTfLiteTensorFromFlatbuffer(
// of a sequential, array of ScratchBufferHandle allocations in the tail
// section. These allocations are indexed by the request API defined in the
// TfLiteContext struct.
typedef struct {
struct ScratchBufferRequest {
// Number of bytes required by the buffer. The actual allocated size might be
// greater than `bytes` due to buffer alignment.
size_t bytes;
......@@ -63,29 +63,29 @@ typedef struct {
// have `before` = node_idx and `after` = node_idx.
int node_idx;
int subgraph_idx;
} ScratchBufferRequest;
};
} // namespace internal
typedef struct {
struct NodeAndRegistration {
TfLiteNode node;
const TfLiteRegistration* registration;
} NodeAndRegistration;
};
// Holds a pointer to a buffer for a scratch buffer requested by a kernel during
// the model prepare stage. This struct is allocated in-place and allows for
// quick pointer-indexed lookup for speed during model inference.
typedef struct {
struct ScratchBufferHandle {
// Pointer to location of the scratch buffer:
uint8_t* data;
} ScratchBufferHandle;
};
// Stores all per-subgraph allocations. This includes the node and registration
// array, tensor list and scratch buffer handles for each subgraph.
typedef struct {
struct SubgraphAllocations {
NodeAndRegistration* node_and_registrations;
TfLiteEvalTensor* tensors;
} SubgraphAllocations;
};
// Allocator responsible for allocating memory for all intermediate tensors
// necessary to invoke a model.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册