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

Function copy_tensor

tests/SimpleTensor.h:234–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233template <typename T1, typename T2>
234SimpleTensor<T1> copy_tensor(const SimpleTensor<T2> &tensor)
235{
236 SimpleTensor<T1> st(tensor.shape(), tensor.data_type(), tensor.num_channels(), tensor.quantization_info(),
237 tensor.data_layout());
238 for (size_t n = 0; n < size_t(st.num_elements()); n++)
239 {
240 st.data()[n] = static_cast<T1>(tensor.data()[n]);
241 }
242 return st;
243}
244
245template <typename T1, typename T2, typename std::enable_if<std::is_same<T1, T2>::value, int>::type = 0>
246SimpleTensor<T1> copy_tensor(const SimpleTensor<half> &tensor)

Callers

nothing calls this directly

Calls 7

shapeMethod · 0.45
data_typeMethod · 0.45
num_channelsMethod · 0.45
quantization_infoMethod · 0.45
data_layoutMethod · 0.45
num_elementsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected