Skip to content

Commit

Permalink
[Other] Fix compile error on linux aarch64 (PaddlePaddle#752)
Browse files Browse the repository at this point in the history
Fix compile error on linux aarch64
  • Loading branch information
jiangjiajun authored Nov 30, 2022
1 parent e79dc86 commit 9d78b1d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fastdeploy/function/sort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ void SortKernel(const FDTensor& x, FDTensor* out, FDTensor* indices,
axis = (axis < 0) ? (rank + axis) : axis;
// Do full sort
if (axis == -1 || axis + 1 == rank) {
const int64_t input_width = input_shape[rank - 1];
const int64_t input_height = x.Numel() / input_width;
int64_t numel = x.Numel();
int64_t input_width = input_shape[axis];
int64_t input_height = numel / input_width;
FD_VISIT_INT_TYPES(indices_type, "FullSort", ([&] {
FullSort<T, data_t>(input_height, input_width, rank,
&x, out, indices, descending);
Expand All @@ -93,8 +94,9 @@ void SortKernel(const FDTensor& x, FDTensor* out, FDTensor* indices,

FDTensor trans_inp;
Transpose(x, &trans_inp, trans);
const int64_t input_width = input_shape[axis];
const int64_t input_height = x.Numel() / input_width;
int64_t numel = x.Numel();
int64_t input_width = input_shape[axis];
int64_t input_height = numel / input_width;
FD_VISIT_INT_TYPES(indices_type, "FullSort", ([&] {
FullSort<T, data_t>(input_height, input_width, rank,
&trans_inp, out, indices,
Expand All @@ -115,4 +117,4 @@ void Sort(const FDTensor& x, FDTensor* out, FDTensor* indices, int axis,
}

} // namespace function
} // namespace fastdeploy
} // namespace fastdeploy

0 comments on commit 9d78b1d

Please sign in to comment.