// // This confidential and proprietary software may be used only as // authorised by a licensing agreement from ARM Limited // (C) COPYRIGHT 2020-2024 ARM Limited // ALL RIGHTS RESERVED // The entire notice above must be reproduced on all authorised // copies and copies may only be made to the extent permitted // by a licensing agreement from ARM Limited. ERROR_IF(in_t != i8_t && input_zp != 0); // Zero point only for int8_t ERROR_IF(weight_t != i8_t && weight_zp != 0); ERROR_IF(BC != OC && BC != 1); for_each(0 <= n < N, 0 <= oc < OC) { out_t acc = 0; for_each(0 <= ic < IC) { out_t value = static_cast(tensor_read(input, [N,IC], [n,ic])); out_t weight = static_cast(tensor_read(weight, [OC,IC], [oc,ic])); value = apply_sub_s(value, static_cast(input_zp)); weight = apply_sub_s(weight, static_cast(weight_zp)); acc = apply_add_s(acc, apply_mul_s(value, weight)); } acc = apply_add_s(acc, bias[(BC == 1) ? 0 : oc]); tensor_write(output, [N,OC], [n,oc], acc); }