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

Function unstack

tests/validation/reference/Unstack.cpp:90–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89template <typename T>
90std::vector<SimpleTensor<T>>
91unstack(const SimpleTensor<T> &input_tensor, std::vector<SimpleTensor<T>> &output_tensors, int axis)
92{
93 // Wrap around negative values
94 const unsigned int axis_u = wrap_around(axis, static_cast<int>(input_tensor.shape().num_dimensions()));
95 ARM_COMPUTE_ERROR_ON(axis_u >= input_tensor.shape().num_dimensions());
96 for (size_t k = 0; k < output_tensors.size(); ++k)
97 {
98 SimpleTensor<T> &output = output_tensors[k];
99 const SimpleTensor<T> kth_slice = get_slice(input_tensor, axis_u, k);
100 output = copy_tensor<T>(kth_slice);
101 }
102 return output_tensors;
103}
104
105template std::vector<SimpleTensor<float>>
106unstack(const SimpleTensor<float> &input_tensor, std::vector<SimpleTensor<float>> &output_tensors, int axis);

Callers

nothing calls this directly

Calls 5

wrap_aroundFunction · 0.85
get_sliceFunction · 0.85
num_dimensionsMethod · 0.45
shapeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected