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

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

* add int32->int64 cast arm cpu kernel. test=develop
上级 8e652fe5
......@@ -72,6 +72,12 @@ void CastCompute::Run() {
const int64_t* x_data_end = x_data_begin + param.X->numel();
float* out_data = param.Out->mutable_data<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 {
LOG(FATAL) << "other has not been implemented transform with dtype"
<< 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.
先完成此消息的编辑!
想要评论请 注册