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

Method IsConvolution2dSupported

src/armnn/BackendHelper.cpp:371–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371bool 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
425bool LayerSupportHandle::IsConvolution3dSupported(const TensorInfo& input,
426 const TensorInfo& output,

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