| 470 | } |
| 471 | |
| 472 | bool LayerSupportHandle::IsDepthwiseConvolutionSupported( |
| 473 | const TensorInfo& input, |
| 474 | const TensorInfo& output, |
| 475 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 476 | const TensorInfo& weights, |
| 477 | const Optional<TensorInfo>& biases, |
| 478 | Optional<std::string&> reasonIfUnsupported) |
| 479 | { |
| 480 | TensorInfo biasesVal = biases.has_value() ? biases.value() : TensorInfo(); |
| 481 | TensorInfos infos{input, output, weights, biasesVal}; |
| 482 | |
| 483 | Optional<const BackendOptions::BackendOption> capability ; |
| 484 | if (!m_BackendId.IsUndefined()) |
| 485 | { |
| 486 | capability = GetCapability("NonConstWeights", m_BackendId); |
| 487 | if (!capability.has_value() || capability.value().GetValue().AsBool() == false) |
| 488 | { |
| 489 | if (!weights.IsConstant()) |
| 490 | { |
| 491 | if (reasonIfUnsupported.has_value()) |
| 492 | { |
| 493 | reasonIfUnsupported.value() = |
| 494 | "Backend is not capable of supporting dynamic weights (NonConstWeights) and " |
| 495 | "DepthwiseConvolution2d weights are set as dynamic (non constant). "; |
| 496 | } |
| 497 | return false; |
| 498 | } |
| 499 | if (descriptor.m_BiasEnabled && !biasesVal.IsConstant()) |
| 500 | { |
| 501 | if (reasonIfUnsupported.has_value()) |
| 502 | { |
| 503 | reasonIfUnsupported.value() = |
| 504 | "Backend is not capable of supporting dynamic biases (NonConstWeights) and " |
| 505 | "DepthwiseConvolution2d biases are set as dynamic (non constant). "; |
| 506 | } |
| 507 | return false; |
| 508 | } |
| 509 | // At the first stage we will only print a warning. this is to give |
| 510 | // backend developers a chance to adopt and read weights from input slots. |
| 511 | ARMNN_LOG(warning) << "The backend makes use of a deprecated interface to read constant tensors. " |
| 512 | "If you are a backend developer please find more information in our " |
| 513 | "doxygen documentation on github https://github.com/ARM-software/armnn " |
| 514 | "under the keyword 'ConstTensorsAsInputs'."; |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | return m_LayerSupport->IsLayerSupported(LayerType::DepthwiseConvolution2d, |
| 519 | infos, |
| 520 | descriptor, |
| 521 | EmptyOptional(), |
| 522 | EmptyOptional(), |
| 523 | reasonIfUnsupported); |
| 524 | } |
| 525 | |
| 526 | bool LayerSupportHandle::IsDequantizeSupported(const TensorInfo& input, |
| 527 | const TensorInfo& output, |
nothing calls this directly
no test coverage detected