| 38 | { |
| 39 | |
| 40 | bool LayerSupportBase::IsLayerSupported(const LayerType& type, |
| 41 | const std::vector<TensorInfo>& infos, |
| 42 | const BaseDescriptor& descriptor, |
| 43 | const Optional<LstmInputParamsInfo>&, |
| 44 | const Optional<QuantizedLstmInputParamsInfo>&, |
| 45 | Optional<std::string&> reasonIfUnsupported) const |
| 46 | { |
| 47 | switch(type) |
| 48 | { |
| 49 | case LayerType::MemCopy: |
| 50 | return IsMemCopySupported(infos[0], infos[1], reasonIfUnsupported); |
| 51 | case LayerType::MemImport: |
| 52 | return IsMemImportSupported(infos[0], infos[1], reasonIfUnsupported); |
| 53 | case LayerType::StandIn: |
| 54 | { |
| 55 | auto desc = *(PolymorphicDowncast<const StandInDescriptor*>(&descriptor)); |
| 56 | |
| 57 | if (infos.size() != (desc.m_NumInputs + desc.m_NumOutputs)) |
| 58 | { |
| 59 | throw InvalidArgumentException("Number of StandIn layer TensorInfos does not equal " |
| 60 | "the combined number of input and output slots assigned " |
| 61 | "to the StandIn descriptor"); |
| 62 | } |
| 63 | |
| 64 | std::vector<const TensorInfo*> inputInfos; |
| 65 | for (uint32_t i = 0; i < desc.m_NumInputs; i++) |
| 66 | { |
| 67 | inputInfos.push_back(&infos[i]); |
| 68 | } |
| 69 | std::vector<const TensorInfo*> outputInfos; |
| 70 | for (uint32_t i = desc.m_NumInputs; i < infos.size(); i++) |
| 71 | { |
| 72 | outputInfos.push_back(&infos[i]); |
| 73 | } |
| 74 | |
| 75 | return IsStandInSupported(inputInfos, |
| 76 | outputInfos, |
| 77 | desc, |
| 78 | reasonIfUnsupported); |
| 79 | } |
| 80 | default: |
| 81 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | bool LayerSupportBase::IsDetectionPostProcessSupported(const TensorInfo&, // boxEncodings |
| 86 | const TensorInfo&, // scores |
nothing calls this directly
no test coverage detected