MCPcopy Create free account
hub / github.com/ARM-software/armnn / IsDilatedDepthwiseConvolutionSupported

Method IsDilatedDepthwiseConvolutionSupported

src/armnn/BackendHelper.cpp:560–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560bool LayerSupportHandle::IsDilatedDepthwiseConvolutionSupported(
561 const TensorInfo& input,
562 const TensorInfo& output,
563 const DepthwiseConvolution2dDescriptor& descriptor,
564 const TensorInfo& weights,
565 const Optional<TensorInfo>& biases,
566 Optional<std::string&> reasonIfUnsupported)
567{
568 TensorInfo biasesVal = biases.has_value() ? biases.value() : TensorInfo();
569 TensorInfos infos{input, output, weights, biasesVal};
570
571 Optional<const BackendOptions::BackendOption> capability ;
572 if (!m_BackendId.IsUndefined())
573 {
574 capability = GetCapability("NonConstWeights", m_BackendId);
575 if (!capability.has_value() || capability.value().GetValue().AsBool() == false)
576 {
577 if (!weights.IsConstant())
578 {
579 if (reasonIfUnsupported.has_value())
580 {
581 reasonIfUnsupported.value() =
582 "Backend is not capable of supporting dynamic weights (NonConstWeights) and "
583 "DilatedDepthwiseConvolution2d weights are set as dynamic (non constant). ";
584 }
585 return false;
586 }
587 if (descriptor.m_BiasEnabled && !biasesVal.IsConstant())
588 {
589 if (reasonIfUnsupported.has_value())
590 {
591 reasonIfUnsupported.value() =
592 "Backend is not capable of supporting dynamic biases (NonConstWeights) and "
593 "DilatedDepthwiseConvolution2d biases are set as dynamic (non constant). ";
594 }
595 return false;
596 }
597 // At the first stage we will only print a warning. this is to give
598 // backend developers a chance to adopt and read weights from input slots.
599 ARMNN_LOG(warning) << "The backend makes use of a deprecated interface to read constant tensors. "
600 "If you are a backend developer please find more information in our "
601 "doxygen documentation on github https://github.com/ARM-software/armnn "
602 "under the keyword 'ConstTensorsAsInputs'.";
603 }
604 }
605
606 return m_LayerSupport->IsLayerSupported(LayerType::DepthwiseConvolution2d,
607 infos,
608 descriptor,
609 EmptyOptional(),
610 EmptyOptional(),
611 reasonIfUnsupported);
612}
613
614bool LayerSupportHandle::IsDivisionSupported(const TensorInfo& input0,
615 const TensorInfo& input1,

Callers

nothing calls this directly

Calls 10

GetCapabilityFunction · 0.85
IsUndefinedMethod · 0.80
AsBoolMethod · 0.80
IsConstantMethod · 0.80
TensorInfoClass · 0.50
EmptyOptionalClass · 0.50
has_valueMethod · 0.45
valueMethod · 0.45
GetValueMethod · 0.45
IsLayerSupportedMethod · 0.45

Tested by

no test coverage detected