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

Function auto_init_if_empty

src/core/helpers/AutoConfiguration.h:43–59  ·  view source on GitHub ↗

Auto initialize the tensor info (shape, number of channels and data type) if the current assignment is empty. * * @param[in,out] info Tensor info used to check and assign. * @param[in] shape New shape. * @param[in] num_channels New number of channels. * @param[in] data_type New data type * @param[in] quantization_info (Optional) New quant

Source from the content-addressed store, hash-verified

41 * @return True if the tensor info has been initialized
42 */
43inline bool auto_init_if_empty(ITensorInfo &info,
44 const TensorShape &shape,
45 int num_channels,
46 DataType data_type,
47 QuantizationInfo quantization_info = QuantizationInfo())
48{
49 if (info.tensor_shape().total_size() == 0)
50 {
51 info.set_data_type(data_type);
52 info.set_num_channels(num_channels);
53 info.set_tensor_shape(shape);
54 info.set_quantization_info(quantization_info);
55 return true;
56 }
57
58 return false;
59}
60
61/** Auto initialize the tensor info using another tensor info.
62 *

Calls 7

QuantizationInfoClass · 0.50
total_sizeMethod · 0.45
data_typeMethod · 0.45
num_channelsMethod · 0.45
quantization_infoMethod · 0.45
data_layoutMethod · 0.45
are_values_constantMethod · 0.45

Tested by

no test coverage detected