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

Function flatten_layer

tests/validation/reference/FlattenLayer.cpp:35–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33{
34template <typename T>
35SimpleTensor<T> flatten_layer(const SimpleTensor<T> &src, const TensorShape &shape_flatten)
36{
37 SimpleTensor<T> dst(shape_flatten, src.data_type(), 1);
38
39 // Note: Since the reference implementation does not use padding bytes, we can copy directly the content of the source tensor
40 std::copy(src.data(), src.data() + src.num_elements(), dst.data());
41
42 return dst;
43}
44
45template SimpleTensor<float> flatten_layer(const SimpleTensor<float> &src, const TensorShape &shape_flatten);
46template SimpleTensor<half> flatten_layer(const SimpleTensor<half> &src, const TensorShape &shape_flatten);

Callers

nothing calls this directly

Calls 4

copyFunction · 0.70
data_typeMethod · 0.45
dataMethod · 0.45
num_elementsMethod · 0.45

Tested by

no test coverage detected