34 const int outputs_count = params.
num_split;
37 for (
int i = 0; i < params.
axis; i++)
39 outer_size *= input_shape.
Dims(i);
42 for (
int i = params.
axis + 1; i < dimensions; i++)
44 copy_size *= input_shape.
Dims(i);
46 assert(
output_shape.FlatSize() == copy_size * outer_size);
48 for (
int i = 0; i < outputs_count; ++i)
50 for (
int k = 0; k < outer_size; k++)
52 Scalar *output_ptr = output_datas[i] + copy_size * k;
53 int loc = k * outputs_count * copy_size + i * copy_size;
54 memcpy(output_ptr, input_data + loc, copy_size *
sizeof(Scalar));
void Unpack(const UnpackParams ¶ms, const Shape &input_shape, const Scalar *input_data, const Shape &output_shape, Scalar *const *output_datas)