1818#include < executorch/kernels/portable/cpu/util/reduce_util.h>
1919#include < executorch/runtime/kernel/kernel_includes.h>
2020
21- using ::executorch::aten::Scalar;
2221using ::executorch::aten::ScalarType;
2322using ::executorch::aten::Tensor;
2423using ::executorch::runtime::Error;
@@ -32,7 +31,7 @@ using optional = ::executorch::aten::optional<T>;
3231 * operator need to be updated accordingly
3332 */
3433
35- enum datatype { Ushort = 20 , Bits4u = 21 , Bits4 = 22 };
34+ enum datatype { Bits4u = 21 , Bits4 = 22 };
3635
3736/* *
3837 * For an input tensor, use the scale and zero_point arguments to quantize it.
@@ -57,9 +56,8 @@ void check_dequantize_per_tensor_args(
5756 ET_CHECK_MSG (
5857 input.scalar_type () == ScalarType::Byte ||
5958 input.scalar_type () == ScalarType::Char ||
60- input.scalar_type () == ScalarType::Bits16 ||
59+ input.scalar_type () == ScalarType::UInt16 ||
6160 input.scalar_type () == ScalarType::Short ||
62- input.scalar_type () == (ScalarType)Ushort ||
6361 input.scalar_type () == (ScalarType)Bits4 ||
6462 input.scalar_type () == (ScalarType)Bits4u ||
6563 input.scalar_type () == ScalarType::Int,
@@ -154,7 +152,7 @@ Tensor& dequantize_impl(
154152 axis,
155153 zero_point_data,
156154 scale_data);
157- } else if (input.scalar_type () == ( ScalarType)Ushort ) {
155+ } else if (input.scalar_type () == ScalarType::UInt16 ) {
158156 const uint16_t * input_data = input.const_data_ptr <uint16_t >();
159157 XT_KERNEL_CHECK (
160158 ctx,
@@ -236,7 +234,7 @@ Tensor& dequantize_impl(
236234 break ;
237235 switch (input.scalar_type ()) {
238236 ET_FORALL_INT_TYPES (ASYM_CALCULATE_INT_TYPE_TENSOR);
239- ASYM_CALCULATE_INT_TYPE_TENSOR (uint16_t , Bits16 );
237+ ASYM_CALCULATE_INT_TYPE_TENSOR (uint16_t , UInt16 );
240238 default :
241239 ET_CHECK_MSG (
242240 false ,
@@ -328,7 +326,7 @@ Tensor& dequantize_impl(
328326 break ;
329327 switch (input.scalar_type ()) {
330328 ET_FORALL_INT_TYPES (ASYM_CALCULATE_INT_TYPE_CHANNEL);
331- ASYM_CALCULATE_INT_TYPE_CHANNEL (uint16_t , Bits16 );
329+ ASYM_CALCULATE_INT_TYPE_CHANNEL (uint16_t , UInt16 );
332330 default :
333331 ET_CHECK_MSG (
334332 false ,
@@ -364,7 +362,7 @@ Tensor& dequantize_impl(
364362 input.dim (),
365363 axis,
366364 scale_data);
367- } else if (input.scalar_type () == ( ScalarType)Ushort ) {
365+ } else if (input.scalar_type () == ScalarType::UInt16 ) {
368366 const uint16_t * input_data = input.const_data_ptr <uint16_t >();
369367 XT_KERNEL_CHECK (
370368 ctx,
@@ -442,7 +440,7 @@ Tensor& dequantize_impl(
442440 break ;
443441 switch (input.scalar_type ()) {
444442 ET_FORALL_INT_TYPES (SYM_CALCULATE_INT_TYPE_TENSOR);
445- SYM_CALCULATE_INT_TYPE_TENSOR (uint16_t , Bits16 );
443+ SYM_CALCULATE_INT_TYPE_TENSOR (uint16_t , UInt16 );
446444 default :
447445 ET_CHECK_MSG (
448446 false ,
@@ -534,7 +532,7 @@ Tensor& dequantize_impl(
534532 break ;
535533 switch (input.scalar_type ()) {
536534 ET_FORALL_INT_TYPES (SYM_CALCULATE_INT_TYPE_CHANNEL);
537- SYM_CALCULATE_INT_TYPE_CHANNEL (uint16_t , Bits16 );
535+ SYM_CALCULATE_INT_TYPE_CHANNEL (uint16_t , UInt16 );
538536 default :
539537 ET_CHECK_MSG (
540538 false ,
0 commit comments