Lines Matching refs:int32_t
10 void ApplyLayerNorm(const int16_t* input, const int16_t* layer_norm_weights, const int32_t* bias, in ApplyLayerNorm()
11 int32_t layer_norm_scale_a, int32_t layer_norm_scale_b, int32_t variance_limit, in ApplyLayerNorm()
18 const int32_t index = i * n_input + j; in ApplyLayerNorm()
19 int32_t val = static_cast<int32_t>(input[index]); in ApplyLayerNorm()
23 int32_t mean = static_cast<int32_t>(static_cast<int64_t>(sum) * 1024 / n_input); in ApplyLayerNorm()
25 int32_t temp = kOverflowGuard / n_input; in ApplyLayerNorm()
27 int32_t variance2 = static_cast<int32_t>(variance / kOverflowGuard); in ApplyLayerNorm()
31 int32_t stddev_inverse_a; in ApplyLayerNorm()
37 const int32_t index = i * n_input + j; in ApplyLayerNorm()
38 int32_t val = static_cast<int32_t>(input[index]); in ApplyLayerNorm()
39 int32_t shifted = 1024 * val - mean; in ApplyLayerNorm()
40 int32_t rescaled = in ApplyLayerNorm()
44 int32_t val4 = static_cast<int32_t>((val3 > 0 ? val3 + 512 : val3 - 512) / 1024); in ApplyLayerNorm()
45 int32_t val5 = MultiplyByQuantizedMultiplier(val4, layer_norm_scale_a, in ApplyLayerNorm()
53 void MatrixScalarMultiplyAccumulate(const int8_t* matrix, int32_t scalar, int32_t n_row, in MatrixScalarMultiplyAccumulate()
54 int32_t n_col, int32_t* output) { in MatrixScalarMultiplyAccumulate()
56 int32_t row_sum = 0; in MatrixScalarMultiplyAccumulate()
64 bool PrecomputeZeroPointTimesWeightWithBias(int32_t zero_point, const int8_t* weight_tensor, in PrecomputeZeroPointTimesWeightWithBias()
65 const Shape& weight_shape, const int32_t* bias_tensor, in PrecomputeZeroPointTimesWeightWithBias()
66 std::unique_ptr<int32_t[]>* output) { in PrecomputeZeroPointTimesWeightWithBias()
74 *output = std::make_unique<int32_t[]>(row); in PrecomputeZeroPointTimesWeightWithBias()
76 memset(output->get(), 0, row * sizeof(int32_t)); in PrecomputeZeroPointTimesWeightWithBias()
78 memcpy(output->get(), bias_tensor, row * sizeof(int32_t)); in PrecomputeZeroPointTimesWeightWithBias()
86 void ApplySigmoid(const int16_t* input, int32_t n_batch, int32_t n_input, int16_t* output) { in ApplySigmoid()
106 const int32_t value = static_cast<int32_t>(a) * static_cast<int32_t>(b); in CwiseMul()
112 void CwiseMul(const int16_t* input_1, const int16_t* input_2, int32_t multiplier, int32_t shift, in CwiseMul()
113 int32_t n_batch, int32_t n_input, int32_t output_zp, int8_t* output) { in CwiseMul()
119 int32_t value = static_cast<int32_t>(a) * static_cast<int32_t>(b); in CwiseMul()
143 int32_t sum = input_1[index] + input_2[index]; in CwiseAdd()
144 const int32_t sum_clamped = std::min(INT16_MAX, std::max(INT16_MIN, sum)); in CwiseAdd()
150 void CwiseClipping(int16_t* input, const int16_t clipping_value, int32_t n_batch, int32_t n_input) { in CwiseClipping()
164 void CwiseClipping(int8_t* input, const int8_t clipping_value, int32_t n_batch, int32_t n_input) { in CwiseClipping()
180 int32_t multiplier, int shift, int16_t* result) { in VectorBatchVectorCwiseProductAccumulate()
183 int32_t prod = vector[v] * *batch_vector++; in VectorBatchVectorCwiseProductAccumulate()
185 int32_t output = prod + *result; in VectorBatchVectorCwiseProductAccumulate()