// // 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. REQUIRE(length(table) == TABLE_SIZE); for_each(index in shape) { in_t value = tensor_read(input, shape, index); out_t result; if (in_t == i8_t) { // value is a signed int, convert to a 0 based index result = table[static_cast(value) + 128]; } else { result = apply_lookup_s(static_cast(table), static_cast(value)); } tensor_write(output, shape, index, result); }