| 369 | } |
| 370 | |
| 371 | bool LayerSupportHandle::IsConvolution2dSupported(const TensorInfo& input, |
| 372 | const TensorInfo& output, |
| 373 | const Convolution2dDescriptor& descriptor, |
| 374 | const TensorInfo& weights, |
| 375 | const Optional<TensorInfo>& biases, |
| 376 | Optional<std::string&> reasonIfUnsupported) |
| 377 | { |
| 378 | TensorInfo biasesVal = biases.has_value() ? biases.value() : TensorInfo(); |
| 379 | TensorInfos infos{input, output, weights, biasesVal}; |
| 380 | |
| 381 | Optional<const BackendOptions::BackendOption> capability ; |
| 382 | if (!m_BackendId.IsUndefined()) |
| 383 | { |
| 384 | capability = GetCapability("NonConstWeights", m_BackendId); |
| 385 | if (!capability.has_value() || capability.value().GetValue().AsBool() == false) |
| 386 | { |
| 387 | if (!weights.IsConstant()) |
| 388 | { |
| 389 | if (reasonIfUnsupported.has_value()) |
| 390 | { |
| 391 | reasonIfUnsupported.value() = |
| 392 | "Backend is not capable of supporting dynamic weights (NonConstWeights) and " |
| 393 | "Convolution2d weights are set as dynamic (non constant). "; |
| 394 | } |
| 395 | return false; |
| 396 | } |
| 397 | if (descriptor.m_BiasEnabled && !biasesVal.IsConstant()) |
| 398 | { |
| 399 | if (reasonIfUnsupported.has_value()) |
| 400 | { |
| 401 | reasonIfUnsupported.value() = |
| 402 | "Backend is not capable of supporting dynamic biases (NonConstWeights) and " |
| 403 | "Convolution2d biases are set as dynamic (non constant). "; |
| 404 | } |
| 405 | return false; |
| 406 | } |
| 407 | |
| 408 | // At the first stage we will only print a warning. this is to give |
| 409 | // backend developers a chance to adopt and read weights from input slots. |
| 410 | ARMNN_LOG(warning) << "The backend makes use of a deprecated interface to read constant tensors. " |
| 411 | "If you are a backend developer please find more information in our " |
| 412 | "doxygen documentation on github https://github.com/ARM-software/armnn " |
| 413 | "under the keyword 'ConstTensorsAsInputs'."; |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | return m_LayerSupport->IsLayerSupported(LayerType::Convolution2d, |
| 418 | infos, |
| 419 | descriptor, |
| 420 | EmptyOptional(), |
| 421 | EmptyOptional(), |
| 422 | reasonIfUnsupported); |
| 423 | } |
| 424 | |
| 425 | bool LayerSupportHandle::IsConvolution3dSupported(const TensorInfo& input, |
| 426 | const TensorInfo& output, |
nothing calls this directly
no test coverage detected