| 102 | } |
| 103 | |
| 104 | Status CLUnstack::validate(const ITensorInfo *input, const std::vector<ITensorInfo *> &output_vector, int axis) |
| 105 | { |
| 106 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input); |
| 107 | ARM_COMPUTE_RETURN_ERROR_ON(output_vector.empty()); |
| 108 | ARM_COMPUTE_RETURN_ERROR_ON_DYNAMIC_SHAPE(input); |
| 109 | for (const auto &output : output_vector) |
| 110 | { |
| 111 | ARM_COMPUTE_RETURN_ERROR_ON_DYNAMIC_SHAPE(output); |
| 112 | } |
| 113 | ARM_COMPUTE_RETURN_ERROR_ON(axis < (-static_cast<int>(input->tensor_shape().num_dimensions()))); |
| 114 | ARM_COMPUTE_RETURN_ERROR_ON(axis >= static_cast<int>(input->tensor_shape().num_dimensions())); |
| 115 | const unsigned int num_slices = std::min(output_vector.size(), input->dimension(wrap_axis(axis, input))); |
| 116 | ARM_COMPUTE_RETURN_ERROR_ON(num_slices > input->dimension(wrap_axis(axis, input))); |
| 117 | ARM_COMPUTE_RETURN_ERROR_ON(num_slices > output_vector.size()); |
| 118 | Coordinates slice_start; |
| 119 | int32_t slice_end_mask; |
| 120 | for (size_t k = 0; k < num_slices; ++k) |
| 121 | { |
| 122 | slice_start.set(wrap_axis(axis, input), k); |
| 123 | setup_slice_coordinates_and_mask(slice_start, slice_end_mask, input->tensor_shape().num_dimensions()); |
| 124 | ARM_COMPUTE_RETURN_ON_ERROR(CLStridedSlice::validate(input, output_vector[k], slice_start, Coordinates(), |
| 125 | BiStrides(), 0, slice_end_mask, |
| 126 | (1 << wrap_axis(axis, input)))); |
| 127 | } |
| 128 | return Status{}; |
| 129 | } |
| 130 | |
| 131 | void CLUnstack::run() |
| 132 | { |
nothing calls this directly
no test coverage detected