35 for (
int i = 0; i < axis; ++i)
37 outer_size *= input_shape.
Dims(i);
43 copy_size *= input_shape.
Dims(i);
46 const int dims_at_axis = input_shape.
Dims(axis);
47 for (
int i = 0; i < outer_size; ++i)
49 for (
int j = 0; j < dims_at_axis; ++j)
51 const int start_pos = (i * dims_at_axis + j) * copy_size;
52 Scalar *output_ptr = output_data + start_pos;
53 int loc = (i * dims_at_axis + dims_at_axis - j - 1) * copy_size;
54 memcpy(output_ptr, input_data + loc, copy_size *
sizeof(Scalar));