The problem with input data after quantifying the model with Int8
@panhu Before quantization, could you try to scale your int16 data to a smaller range centered around 0. This will ensure a wider distribution within the limited int8 range, reducing the risk of values becoming 0 or 127 after conversion. You can use techniques like min-max scaling or standard normalization. Please save the scaling factors and apply them in reverse during inference to recover the original data values.

Thank you! Thanks，I have an important question about the convolution calculation method used by tflite. The following is the convolution calculation method I used, but with the same weights and biases, the results obtained are different? Can you help me take a look？

void convolve_HWC_q7_nonsquare(const q7_t *Im_in,                // input image
	const uint16_t dim_im_in_x,                                        // input image dimention x
	const uint16_t dim_im_in_y,                                        // input image dimention y
	const uint16_t ch_im_in,                                           // number of input image channels
	const q7_t *wt,                                                    // kernel weights
	const uint16_t ch_im_out,                                          // number of filters, i.e., output image channels
	const uint16_t dim_kernel_x,                                       // filter kernel size x
	const uint16_t dim_kernel_y,                                       // filter kernel size y
	const uint16_t padding_x,                                          // padding sizes x
	const uint16_t padding_y,                                          // padding sizes y
	const uint16_t stride_x,                                           // stride x
	const uint16_t stride_y,                                           // stride y
    const uint16_t dilation_x,                                         // dilation x
	const uint16_t dilation_y,                                         // dilation y
	const q31_t *bias,                                                  // bias
	const nnom_qformat_param_t *bias_shift,                                        // bias shifts
    const nnom_qformat_param_t *out_shift,                                         // output shift
    const nnom_qtype_t q_type,                                         // per channel or per tensor
    q7_t *Im_out,                                                      // output image
	const uint16_t dim_im_out_x,                                       // output image dimension x
	const uint16_t dim_im_out_y,                                       // output image dimension y
	q15_t *bufferA,                                                    //buffer space for input
	q7_t *bufferB                                                      //buffer space for output
)
{
    int i, j, k, l, m, n;
    int conv_out;
    int in_row, in_col;
    int in_pix_loc, wt_loc;
    int shift_idx, shift_steps;
    if(q_type == NNOM_QTYPE_PER_AXIS)
        shift_steps = 1;
    else
        shift_steps = 0;

    for (i = 0, shift_idx = 0; i < ch_im_out; i++, shift_idx += shift_steps)
    {
        for (j = 0; j < dim_im_out_y; j++)
        {
            int32_t base_idx_y = stride_y * j - padding_y;
            for (k = 0; k < dim_im_out_x; k++)
            {
				int32_t base_idx_x = stride_x * k - padding_x;
                int32_t ker_y_start = MAX(0, -(base_idx_y-(dilation_y-1))/dilation_y);
                int32_t ker_x_start = MAX(0, -(base_idx_x-(dilation_x-1))/dilation_x);
                int32_t ker_y_end = MIN(dim_kernel_y, (dim_im_in_y - base_idx_y + (dilation_y-1))/dilation_y);
                int32_t ker_x_end = MIN(dim_kernel_x, (dim_im_in_x - base_idx_x + (dilation_x-1))/dilation_x);

                if(bias){
                   // printf("2222\n\n");
                    conv_out = bias[i];//((q31_t)(bias[i]) << bias_shift[shift_idx]) + NNOM_ROUND(out_shift[shift_idx]);
                     }
                else{
                        printf("1111\n\n");
                        conv_out = (q31_t) NNOM_ROUND(out_shift[shift_idx]);
                    }
                for (m = ker_y_start; m < ker_y_end; m++)
                {
                    for (n = ker_x_start; n < ker_x_end; n++)
                    {
                        in_row = stride_y * j + m * dilation_y - padding_y;
                        in_col = stride_x * k + n * dilation_x - padding_x;

                        // pre-calculate the pixel location and weight location to improve the performance.
                        in_pix_loc = (in_row * dim_im_in_x + in_col) * ch_im_in;
                        wt_loc = i * ch_im_in * dim_kernel_y * dim_kernel_x + (m * dim_kernel_x + n) * ch_im_in;
                        
                        for (l = 0; l < ch_im_in; l++)
                        {    
                            conv_out += Im_in[in_pix_loc + l] * wt[wt_loc + l];
                        } 
                    }
                }

                Im_out[i + (j * dim_im_out_x + k) * ch_im_out] =conv_out; //(q7_t)conv_out;//(q7_t)__NNOM_SSAT((conv_out >> out_shift[shift_idx]), 8);
            }
        }
    }
}
 @panhu Please refer to the official TFLite [documentation](https://www.tensorflow.org/lite/guide/ops_version) for detailed descriptions of its convolution operations .
Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.
### 1. System information

- Linux Ubuntu 16.04
- TensorFlow installation (pip package or built from source):
- TensorFlow library

#### Option A: Reference colab notebooks

I would like to ask how to process my model as input after quantifying it with int8 and setting the input-output of tflite to int8, when my input is int16 data and it has undergone rfft. Because if only simple int8 type conversion is used, a large amount of data will become 127 or 0.
