MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / validate

Method validate

src/runtime/CL/functions/CLUnstack.cpp:104–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104Status 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
131void CLUnstack::run()
132{

Callers

nothing calls this directly

Calls 9

wrap_axisFunction · 0.70
validateFunction · 0.50
CoordinatesClass · 0.50
emptyMethod · 0.45
num_dimensionsMethod · 0.45
sizeMethod · 0.45
dimensionMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected