1111#include < executorch/runtime/core/exec_aten/testing_util/tensor_factory.h>
1212#include < executorch/runtime/core/exec_aten/testing_util/tensor_util.h>
1313#include < executorch/runtime/core/exec_aten/util/scalar_type_util.h>
14+ #include < executorch/runtime/platform/runtime.h>
1415#include < executorch/test/utils/DeathTest.h>
1516
1617#include < gtest/gtest.h>
@@ -57,10 +58,12 @@ void test_dtype() {
5758}
5859
5960TEST (OpDequantizeOutTest, AllDtypesSupported) {
61+ et_pal_init ();
6062 test_dtype<ScalarType::Byte>();
6163}
6264
6365TEST (OpDequantizeOutTest, NonWholeNumbers) {
66+ et_pal_init ();
6467 TensorFactory<ScalarType::Byte> tf;
6568
6669 Tensor input = tf.full ({3 , 5 }, 100 );
@@ -87,6 +90,7 @@ TEST(OpDequantizeOutTest, NonWholeNumbers) {
8790}
8891
8992TEST (OpDequantizeOutTest, TensorArgOverload) {
93+ et_pal_init ();
9094 TensorFactory<ScalarType::Byte> tf_byte;
9195 TensorFactory<ScalarType::Double> tf_double;
9296 TensorFactory<ScalarType::Long> tf_long;
@@ -115,12 +119,13 @@ TEST(OpDequantizeOutTest, TensorArgOverload) {
115119}
116120
117121TEST (OpDequantizeOutTest, DequantizePerChannel) {
122+ et_pal_init ();
118123 TensorFactory<ScalarType::Byte> tf_byte;
119- TensorFactory<ScalarType::Float> tf_float ;
124+ TensorFactory<ScalarType::Double> tf_double ;
120125 TensorFactory<ScalarType::Long> tf_long;
121126
122127 Tensor input = tf_byte.full ({3 , 2 }, 100 );
123- Tensor scale = tf_float .make ({2 }, {0.5 , 1 });
128+ Tensor scale = tf_double .make ({2 }, {0.5 , 1 });
124129 Tensor zero_point = tf_long.make ({2 }, {30 , 60 });
125130 int64_t quant_min = 0 ;
126131 int64_t quant_max = 255 ;
@@ -145,7 +150,7 @@ TEST(OpDequantizeOutTest, DequantizePerChannel) {
145150
146151 // Test with a different axis
147152 out = tfo.zeros ({3 , 2 });
148- scale = tf_float .make ({3 }, {0.5 , 0.75 , 1 });
153+ scale = tf_double .make ({3 }, {0.5 , 0.75 , 1 });
149154 zero_point = tf_long.make ({3 }, {30 , 50 , 60 });
150155 // (100 - 30) * 0.5
151156 // (100 - 50) * 0.75
@@ -167,7 +172,7 @@ TEST(OpDequantizeOutTest, DequantizePerChannel) {
167172 // Test with a different axis
168173 out = tfo.zeros ({3 });
169174 input = tf_byte.make ({3 }, {100 , 100 , 100 });
170- scale = tf_float .make ({3 }, {0.5 , 0.75 , 1 });
175+ scale = tf_double .make ({3 }, {0.5 , 0.75 , 1 });
171176 zero_point = tf_long.make ({3 }, {30 , 50 , 60 });
172177 // (100 - 30) * 0.5
173178 // (100 - 50) * 0.75
0 commit comments