[Bug Fix] fix lite int64 datatype convert (#892)

Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
DefTruth
2022-12-16 13:29:56 +08:00
committed by GitHub
parent 2d998223ac
commit 6060f4060b

View File

@@ -249,12 +249,12 @@ bool LiteBackend::Infer(std::vector<FDTensor>& inputs,
reinterpret_cast<const uint8_t*>(const_cast<void*>( reinterpret_cast<const uint8_t*>(const_cast<void*>(
inputs[i].CpuData()))); inputs[i].CpuData())));
} else if (inputs[i].dtype == FDDataType::INT64) { } else if (inputs[i].dtype == FDDataType::INT64) {
#ifdef __aarch64__ #if (defined(__aarch64__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_ARM64))
tensor->CopyFromCpu<int64_t, paddle::lite_api::TargetType::kHost>( tensor->CopyFromCpu<int64_t, paddle::lite_api::TargetType::kHost>(
reinterpret_cast<const int64_t*>(const_cast<void*>( reinterpret_cast<const int64_t*>(const_cast<void*>(
inputs[i].CpuData()))); inputs[i].CpuData())));
#else #else
FDASSERT(false, "FDDataType::INT64 is not support for Arm v7 now!"); FDASSERT(false, "FDDataType::INT64 is not support for x86/armv7 now!");
#endif #endif
} else { } else {
FDASSERT(false, "Unexpected data type of %d.", inputs[i].dtype); FDASSERT(false, "Unexpected data type of %d.", inputs[i].dtype);