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

Method validate

src/runtime/NEON/functions/NEUnstack.cpp:98–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98Status NEUnstack::validate(const ITensorInfo *input, const std::vector<ITensorInfo *> &output_vector, int axis)
99{
100 ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "NEUnstack::validate");
101 ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input);
102 ARM_COMPUTE_RETURN_ERROR_ON(output_vector.empty());
103 ARM_COMPUTE_RETURN_ERROR_ON(axis < (-static_cast<int>(input->tensor_shape().num_dimensions())));
104 ARM_COMPUTE_RETURN_ERROR_ON(axis >= static_cast<int>(input->tensor_shape().num_dimensions()));
105
106 ARM_COMPUTE_RETURN_ERROR_ON_DYNAMIC_SHAPE(input);
107 for (const auto &output : output_vector)
108 {
109 ARM_COMPUTE_RETURN_ERROR_ON_DYNAMIC_SHAPE(output);
110 }
111
112 const unsigned int num_slices = std::min(output_vector.size(), input->dimension(wrap_axis(axis, input)));
113 ARM_COMPUTE_RETURN_ERROR_ON(num_slices > input->dimension(wrap_axis(axis, input)));
114 ARM_COMPUTE_RETURN_ERROR_ON(num_slices > output_vector.size());
115
116 Coordinates slice_start;
117 int32_t slice_end_mask;
118 for (size_t k = 0; k < num_slices; ++k)
119 {
120 slice_start.set(wrap_axis(axis, input), k);
121 setup_slice_coordinates_and_mask(slice_start, slice_end_mask, input->tensor_shape().num_dimensions());
122 ARM_COMPUTE_RETURN_ON_ERROR(NEStridedSlice::validate(input, output_vector[k], slice_start, Coordinates(),
123 BiStrides(), 0, slice_end_mask,
124 (1 << wrap_axis(axis, input))));
125 }
126 return Status{};
127}
128
129void NEUnstack::run()
130{

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