From 6a583293e6b4807c9b0cae4dbf7e66d428e59cc9 Mon Sep 17 00:00:00 2001 From: George Gekov Date: Mon, 16 Dec 2024 11:29:28 +0000 Subject: [PATCH] ArmBackend: Runtime to accept int8 datatype Allows us to use the quantistion pass in https://github.com/pytorch/executorch/pull/6686/ Change-Id: Ie430c6e209539fc93a5c07ac94543abf81ee7977 --- examples/arm/executor_runner/arm_executor_runner.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/arm/executor_runner/arm_executor_runner.cpp b/examples/arm/executor_runner/arm_executor_runner.cpp index e9c758a60ba..2d08f733eba 100644 --- a/examples/arm/executor_runner/arm_executor_runner.cpp +++ b/examples/arm/executor_runner/arm_executor_runner.cpp @@ -295,6 +295,9 @@ Result prepare_input_tensors( case ScalarType::Float: t.mutable_data_ptr()[j] = 1.; break; + case ScalarType::Char: + t.mutable_data_ptr()[j] = 1; + break; } } } @@ -584,12 +587,18 @@ int main(int argc, const char* argv[]) { i, j, outputs[i].toTensor().const_data_ptr()[j]); - } else { + } else if (t.scalar_type() == ScalarType::Float) { printf( "Output[%d][%d]: %f\n", i, j, outputs[i].toTensor().const_data_ptr()[j]); + } else if (t.scalar_type() == ScalarType::Char) { + printf( + "Output[%d][%d]: %d\n", + i, + j, + outputs[i].toTensor().const_data_ptr()[j]); } } #if defined(ET_EVENT_TRACER_ENABLED)