未验证 提交 ebf6b4bb 编写于 作者: Y ysh329 提交者: GitHub

[ARM] Support arm cpu cast from int32 to int64 (#4053)

* add int32->int64 cast arm cpu kernel. test=develop
上级 f65b9b18
...@@ -72,6 +72,12 @@ void CastCompute::Run() { ...@@ -72,6 +72,12 @@ void CastCompute::Run() {
const int64_t* x_data_end = x_data_begin + param.X->numel(); const int64_t* x_data_end = x_data_begin + param.X->numel();
float* out_data = param.Out->mutable_data<float>(); float* out_data = param.Out->mutable_data<float>();
std::transform(x_data_begin, x_data_end, out_data, TransOp<int64_t, float>); std::transform(x_data_begin, x_data_end, out_data, TransOp<int64_t, float>);
} else if (param.in_dtype == 2 && param.out_dtype == 3) { // INT32 -> INT64
const int32_t* x_data_begin = param.X->data<int32_t>();
const int32_t* x_data_end = x_data_begin + param.X->numel();
int64_t* out_data = param.Out->mutable_data<int64_t>();
std::transform(
x_data_begin, x_data_end, out_data, TransOp<int32_t, int64_t>);
} else { } else {
LOG(FATAL) << "other has not been implemented transform with dtype" LOG(FATAL) << "other has not been implemented transform with dtype"
<< param.in_dtype << " X, dtype" << param.out_dtype << " Out"; << param.in_dtype << " X, dtype" << param.out_dtype << " Out";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册