| 701 | } |
| 702 | |
| 703 | bool LayerSupportHandle::IsFullyConnectedSupported(const TensorInfo& input, |
| 704 | const TensorInfo& output, |
| 705 | const TensorInfo& weights, |
| 706 | const TensorInfo& biases, |
| 707 | const FullyConnectedDescriptor& descriptor, |
| 708 | Optional<std::string&> reasonIfUnsupported) |
| 709 | { |
| 710 | TensorInfos infos{input, output, weights, biases}; |
| 711 | |
| 712 | Optional<const BackendOptions::BackendOption> capability; |
| 713 | if (!m_BackendId.IsUndefined()) |
| 714 | { |
| 715 | capability = GetCapability("NonConstWeights", m_BackendId); |
| 716 | if (!capability.has_value() || capability.value().GetValue().AsBool() == false) |
| 717 | { |
| 718 | if (!descriptor.m_ConstantWeights) |
| 719 | { |
| 720 | if (reasonIfUnsupported.has_value()) |
| 721 | { |
| 722 | reasonIfUnsupported.value() = |
| 723 | "Backend is not capable of supporting dynamic weights (NonConstWeights) and " |
| 724 | "FullyConnected descriptor indicates that weights are dynamic (non constant). "; |
| 725 | } |
| 726 | return false; |
| 727 | } |
| 728 | if (!weights.IsConstant()) |
| 729 | { |
| 730 | if (reasonIfUnsupported.has_value()) |
| 731 | { |
| 732 | reasonIfUnsupported.value() = |
| 733 | "Backend is not capable of supporting dynamic weights (NonConstWeights) and " |
| 734 | "FullyConnected weights are set as dynamic (non constant). "; |
| 735 | } |
| 736 | |
| 737 | return false; |
| 738 | } |
| 739 | if (descriptor.m_BiasEnabled && !biases.IsConstant()) |
| 740 | { |
| 741 | if (reasonIfUnsupported.has_value()) |
| 742 | { |
| 743 | reasonIfUnsupported.value() = |
| 744 | "Backend is not capable of supporting dynamic biases (NonConstWeights) and " |
| 745 | "FullyConnected biases are set as dynamic (non constant). "; |
| 746 | } |
| 747 | return false; |
| 748 | } |
| 749 | |
| 750 | // At the first stage we will only print a warning. this is to give |
| 751 | // backend developers a chance to adopt and read weights from input slots. |
| 752 | ARMNN_LOG(warning) << "The backend makes use of a deprecated interface to read constant tensors. " |
| 753 | "If you are a backend developer please find more information in our " |
| 754 | "doxygen documentation on github https://github.com/ARM-software/armnn " |
| 755 | "under the keyword 'ConstTensorsAsInputs'."; |
| 756 | } |
| 757 | } |
| 758 | |
| 759 | return m_LayerSupport->IsLayerSupported(LayerType::FullyConnected, |
| 760 | infos, |
nothing calls this directly
no test coverage detected