| 285 | } |
| 286 | |
| 287 | void ClFullyConnected::configure_conv_fc(const CLCompileContext &compile_context, |
| 288 | ITensorInfo *src, |
| 289 | ITensorInfo *weights, |
| 290 | ITensorInfo *bias, |
| 291 | ITensorInfo *dst, |
| 292 | const FullyConnectedLayerInfo &fc_info) |
| 293 | { |
| 294 | // MatMul fuses transpose operation, so we use the first dimension for comparison where appropriate. |
| 295 | ARM_COMPUTE_ERROR_ON((weights->dimension((_use_matmul && _transpose_weights) ? 0 : 1) != |
| 296 | (src->dimension(0) * src->dimension(1) * src->dimension(2)))); |
| 297 | |
| 298 | // If the fully connected layer is called after a convolution layer, the input tensor must be linearized |
| 299 | |
| 300 | // Initialize output tensor for flatten |
| 301 | _flattened_src = src->clone() |
| 302 | ->set_is_resizable(true) |
| 303 | .reset_padding() |
| 304 | .set_tensor_shape(compute_flatten_shape(src)) |
| 305 | .set_data_layout(DataLayout::NCHW); |
| 306 | |
| 307 | // Configure flatten kernel |
| 308 | _flatten = std::make_unique<ClFlatten>(); |
| 309 | _flatten->configure(compile_context, src, &_flattened_src); |
| 310 | |
| 311 | // Note: if flatten has > 1 dimensions after, these dimensions are batch |
| 312 | // Configure matrix multiply kernel |
| 313 | configure_mm(compile_context, &_flattened_src, weights, bias, dst, fc_info); |
| 314 | } |
| 315 | |
| 316 | void ClFullyConnected::configure_fc_fc(const CLCompileContext &compile_context, |
| 317 | ITensorInfo *src, |
nothing calls this directly
no test coverage detected