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

Method validate

src/runtime/NEON/functions/NEDeconvolutionLayer.cpp:95–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95Status NEDeconvolutionLayer::validate(const ITensorInfo *input,
96 const ITensorInfo *weights,
97 const ITensorInfo *bias,
98 const ITensorInfo *output,
99 const PadStrideInfo &info,
100 bool enable_fast_math,
101 const WeightsInfo &weights_info)
102{
103 ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "NEDeconvolutionLayer::validate");
104 ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, weights, output);
105 ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F32, DataType::F16, DataType::QASYMM8,
106 DataType::QASYMM8_SIGNED);
107 ARM_COMPUTE_RETURN_ERROR_ON_DYNAMIC_SHAPE(input, weights, bias, output);
108 const unsigned int width_idx = get_data_layout_dimension_index(weights->data_layout(), DataLayoutDimension::WIDTH);
109 const unsigned int height_idx =
110 get_data_layout_dimension_index(weights->data_layout(), DataLayoutDimension::HEIGHT);
111 ARM_COMPUTE_RETURN_ERROR_ON(weights->dimension(width_idx) < 1);
112 ARM_COMPUTE_RETURN_ERROR_ON(weights->dimension(height_idx) < 1);
113 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(weights, input);
114 if (is_data_type_quantized_per_channel(weights->data_type()) && is_data_type_quantized(input->data_type()))
115 {
116 ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(weights, 1, DataType::QSYMM8_PER_CHANNEL);
117 }
118 else
119 {
120 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights);
121 }
122
123 const unsigned int pad_left = info.pad_left();
124 const unsigned int pad_top = info.pad_top();
125 const unsigned int pad_right = info.pad_right();
126 const unsigned int pad_bottom = info.pad_bottom();
127
128 ARM_COMPUTE_RETURN_ERROR_ON(((input->dimension(width_idx) - 1) * info.stride().first +
129 weights->dimension(width_idx)) < (pad_left + pad_right));
130 ARM_COMPUTE_RETURN_ERROR_ON(((input->dimension(height_idx) - 1) * info.stride().second +
131 weights->dimension(height_idx)) < (pad_top + pad_bottom));
132
133 auto out_dims =
134 deconvolution_output_dimensions(input->dimension(width_idx), input->dimension(height_idx),
135 weights->dimension(width_idx), weights->dimension(height_idx), info);
136
137 if (bias != nullptr)
138 {
139 if (is_data_type_quantized_asymmetric(input->data_type()))
140 {
141 ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(bias, 1, DataType::S32);
142 }
143 else
144 {
145 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, bias);
146 }
147 }
148
149 if (output->tensor_shape().total_size() > 0)
150 {
151 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
152

Callers

nothing calls this directly

Calls 15

is_data_type_quantizedFunction · 0.85
compute_upsample_infoFunction · 0.85
Size2DClass · 0.85
pad_leftMethod · 0.80
pad_topMethod · 0.80
pad_rightMethod · 0.80

Tested by

no test coverage detected