Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib_nn/api/nn_layers.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,23 @@ void mean_int16(const int16_t *input, int16_t *output, const int start_dim_size,
const int mean_dim_size, const int end_dim_size,
const float scale_mul);

typedef struct {
float lhs_zp;
float rhs_zp;
float in_zp_sum; // channel_size * lhs_zp * rhs_zp
float out_zp;
float scale; // lhs_scale*rhs_scale/out_scale
uint32_t lhs_row_size;
uint32_t channel_size; // lhs col size & rhs row size
uint32_t rhs_col_size;
} nn_mat_mul_real_params_t;
/**
* @brief Execute real matrix multiplication
* @param vpu_buf int8_t vpu_buf[64], need word align
*/
void mat_mul_real_int8(
nn_mat_mul_real_params_t *p,
int8_t *vpu_buf0, int8_t *vpu_buf1, int8_t *vpu_buf2,
int8_t *lhs, int8_t* rhs, int8_t *output);

#endif // LAYERS_H_