Skip to content

Commit 6a58329

Browse files
committed
ArmBackend: Runtime to accept int8 datatype
Allows us to use the quantistion pass in #6686 Change-Id: Ie430c6e209539fc93a5c07ac94543abf81ee7977
1 parent 1bac885 commit 6a58329

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

examples/arm/executor_runner/arm_executor_runner.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ Result<BufferCleanup> prepare_input_tensors(
295295
case ScalarType::Float:
296296
t.mutable_data_ptr<float>()[j] = 1.;
297297
break;
298+
case ScalarType::Char:
299+
t.mutable_data_ptr<int8_t>()[j] = 1;
300+
break;
298301
}
299302
}
300303
}
@@ -584,12 +587,18 @@ int main(int argc, const char* argv[]) {
584587
i,
585588
j,
586589
outputs[i].toTensor().const_data_ptr<int>()[j]);
587-
} else {
590+
} else if (t.scalar_type() == ScalarType::Float) {
588591
printf(
589592
"Output[%d][%d]: %f\n",
590593
i,
591594
j,
592595
outputs[i].toTensor().const_data_ptr<float>()[j]);
596+
} else if (t.scalar_type() == ScalarType::Char) {
597+
printf(
598+
"Output[%d][%d]: %d\n",
599+
i,
600+
j,
601+
outputs[i].toTensor().const_data_ptr<int8_t>()[j]);
593602
}
594603
}
595604
#if defined(ET_EVENT_TRACER_ENABLED)

0 commit comments

Comments
 (0)