Laurent Carlier | 749294b | 2020-06-01 09:03:17 +0100 | [diff] [blame] | 1 | // |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 5 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 6 | #include <Layer.hpp> |
| 7 | #include <LayersFwd.hpp> |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 8 | |
David Beck | b4540be | 2018-09-24 13:18:27 +0100 | [diff] [blame] | 9 | #include <armnn/Types.hpp> |
| 10 | #include <armnn/LayerSupport.hpp> |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 11 | #include <armnn/ILayerSupport.hpp> |
Matteo Martincigh | c601aa6 | 2019-10-29 15:03:22 +0000 | [diff] [blame] | 12 | #include <armnn/BackendRegistry.hpp> |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 13 | #include <armnn/utility/PolymorphicDowncast.hpp> |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 14 | #include <armnn/utility/TransformIterator.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 15 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 16 | #include <backendsCommon/WorkloadFactory.hpp> |
Matteo Martincigh | e5b8eb9 | 2019-11-28 15:45:42 +0000 | [diff] [blame] | 17 | #include <backendsCommon/CpuTensorHandle.hpp> |
Matteo Martincigh | e5b8eb9 | 2019-11-28 15:45:42 +0000 | [diff] [blame] | 18 | |
Francis Murtagh | 46c09d0 | 2019-05-28 08:15:28 +0100 | [diff] [blame] | 19 | #include <backendsCommon/test/WorkloadTestUtils.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 20 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 21 | #include <sstream> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 22 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 23 | namespace armnn |
| 24 | { |
| 25 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 26 | namespace |
| 27 | { |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 28 | using LayerList = std::list<Layer*>; |
| 29 | using Iterator = LayerList::const_iterator; // Const so pointers in the list can't be modified externally. |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 30 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 31 | const TensorInfo OverrideDataType(const TensorInfo& info, Optional<DataType> type) |
| 32 | { |
| 33 | if (!type) |
| 34 | { |
| 35 | return info; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 36 | } |
| 37 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 38 | return TensorInfo(info.GetShape(), type.value(), info.GetQuantizationScale(), info.GetQuantizationOffset()); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 39 | } |
| 40 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 41 | } // anonymous namespace |
| 42 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 43 | bool IWorkloadFactory::IsLayerConfigurationSupported(const BackendId& backendId, |
| 44 | const IConnectableLayer& connectableLayer, |
| 45 | Optional<DataType> dataType, |
| 46 | std::string& outReasonIfUnsupported, |
| 47 | const ModelOptions& modelOptions) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 48 | { |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 49 | Optional<std::string&> reason = outReasonIfUnsupported; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 50 | bool result; |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 51 | const Layer& layer = *(PolymorphicDowncast<const Layer*>(&connectableLayer)); |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 52 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame] | 53 | auto const& backendRegistry = BackendRegistryInstance(); |
| 54 | if (!backendRegistry.IsBackendRegistered(backendId)) |
| 55 | { |
| 56 | std::stringstream ss; |
| 57 | ss << connectableLayer.GetName() << " is not supported on " << backendId |
| 58 | << " because this backend is not registered."; |
| 59 | |
| 60 | outReasonIfUnsupported = ss.str(); |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | auto backendFactory = backendRegistry.GetFactory(backendId); |
| 65 | auto backendObject = backendFactory(); |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 66 | auto layerSupportObject = backendObject->GetLayerSupport(modelOptions); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 67 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 68 | switch(layer.GetType()) |
| 69 | { |
| 70 | case LayerType::Activation: |
| 71 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 72 | auto cLayer = PolymorphicDowncast<const ActivationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 73 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 74 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 75 | result = layerSupportObject->IsActivationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 76 | OverrideDataType(input, dataType), |
| 77 | OverrideDataType(output, dataType), |
| 78 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 79 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 80 | break; |
| 81 | } |
| 82 | case LayerType::Addition: |
| 83 | { |
| 84 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 85 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 86 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 87 | result = layerSupportObject->IsAdditionSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 88 | OverrideDataType(input0, dataType), |
| 89 | OverrideDataType(input1, dataType), |
| 90 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 91 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 92 | break; |
| 93 | } |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 94 | case LayerType::ArgMinMax: |
| 95 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 96 | auto cLayer = PolymorphicDowncast<const ArgMinMaxLayer*>(&layer); |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 97 | const ArgMinMaxDescriptor& descriptor = cLayer->GetParameters(); |
| 98 | |
| 99 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 100 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 101 | result = layerSupportObject->IsArgMinMaxSupported( |
| 102 | OverrideDataType(input, dataType), |
Narumol Prangnawarat | d1f5773 | 2019-10-31 14:24:02 +0000 | [diff] [blame] | 103 | OverrideDataType(output, DataType::Signed32), |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 104 | descriptor, |
| 105 | reason); |
| 106 | break; |
| 107 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 108 | case LayerType::BatchNormalization: |
| 109 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 110 | auto cLayer = PolymorphicDowncast<const BatchNormalizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 111 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 112 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 113 | const TensorInfo& mean = cLayer->m_Mean->GetTensorInfo(); |
| 114 | const TensorInfo& var = cLayer->m_Variance->GetTensorInfo(); |
| 115 | const TensorInfo& beta = cLayer->m_Beta->GetTensorInfo(); |
| 116 | const TensorInfo& gamma = cLayer->m_Gamma->GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 117 | result = layerSupportObject->IsBatchNormalizationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 118 | OverrideDataType(input, dataType), |
| 119 | OverrideDataType(output, dataType), |
| 120 | OverrideDataType(mean, dataType), |
| 121 | OverrideDataType(var, dataType), |
| 122 | OverrideDataType(beta, dataType), |
| 123 | OverrideDataType(gamma, dataType), |
| 124 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 125 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 126 | break; |
| 127 | } |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 128 | case LayerType::BatchToSpaceNd: |
| 129 | { |
| 130 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 131 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 132 | auto cLayer = PolymorphicDowncast<const BatchToSpaceNdLayer*>(&layer); |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 133 | |
| 134 | result = layerSupportObject->IsBatchToSpaceNdSupported(OverrideDataType(input, dataType), |
| 135 | OverrideDataType(output, dataType), |
| 136 | cLayer->GetParameters(), |
| 137 | reason); |
| 138 | break; |
| 139 | } |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 140 | case LayerType::Comparison: |
| 141 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 142 | auto cLayer = PolymorphicDowncast<const ComparisonLayer*>(&layer); |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 143 | |
| 144 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 145 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 146 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 147 | |
| 148 | result = layerSupportObject->IsComparisonSupported(OverrideDataType(input0, dataType), |
| 149 | OverrideDataType(input1, dataType), |
| 150 | OverrideDataType(output, DataType::Boolean), |
| 151 | cLayer->GetParameters(), |
| 152 | reason); |
| 153 | break; |
| 154 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 155 | case LayerType::Constant: |
| 156 | { |
| 157 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 158 | result = layerSupportObject->IsConstantSupported(OverrideDataType(output, dataType), reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 159 | break; |
| 160 | } |
Narumol Prangnawarat | 7ddbbae | 2020-03-13 10:26:05 +0000 | [diff] [blame] | 161 | case LayerType::ConvertBf16ToFp32: |
| 162 | { |
| 163 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 164 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 165 | result = layerSupportObject->IsConvertBf16ToFp32Supported(input, output, reason); |
| 166 | break; |
| 167 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 168 | case LayerType::ConvertFp16ToFp32: |
| 169 | { |
| 170 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 171 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 172 | result = layerSupportObject->IsConvertFp16ToFp32Supported(input, output, reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 173 | break; |
| 174 | } |
Narumol Prangnawarat | ea54a01 | 2020-03-16 16:36:10 +0000 | [diff] [blame] | 175 | case LayerType::ConvertFp32ToBf16: |
| 176 | { |
| 177 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 178 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 179 | result = layerSupportObject->IsConvertFp32ToBf16Supported(input, output, reason); |
| 180 | break; |
| 181 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 182 | case LayerType::ConvertFp32ToFp16: |
| 183 | { |
| 184 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 185 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 186 | result = layerSupportObject->IsConvertFp32ToFp16Supported(input, output, reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 187 | break; |
| 188 | } |
| 189 | case LayerType::Convolution2d: |
| 190 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 191 | auto cLayer = PolymorphicDowncast<const Convolution2dLayer*>(&layer); |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 192 | |
| 193 | const TensorInfo input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 194 | dataType); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 195 | const TensorInfo output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 196 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 197 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 198 | const Convolution2dDescriptor& descriptor = cLayer->GetParameters(); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 199 | |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 200 | // Construct optional biases object based on the value of m_BiasEnabled |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 201 | Optional<TensorInfo> biases; |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 202 | if (descriptor.m_BiasEnabled) |
| 203 | { |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 204 | biases = |
| 205 | OverrideDataType(cLayer->m_Bias->GetTensorInfo(), GetBiasTypeFromWeightsType(dataType)); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 206 | } |
| 207 | |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 208 | result = layerSupportObject->IsConvolution2dSupported( |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 209 | input, |
| 210 | output, |
| 211 | descriptor, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 212 | OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType), |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 213 | biases, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 214 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 215 | break; |
| 216 | } |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 217 | case LayerType::Debug: |
| 218 | { |
| 219 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 220 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 221 | |
| 222 | result = layerSupportObject->IsDebugSupported(OverrideDataType(input, dataType), |
| 223 | OverrideDataType(output, dataType), |
| 224 | reason); |
| 225 | break; |
| 226 | } |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 227 | case LayerType::DepthToSpace: |
| 228 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 229 | auto cLayer = PolymorphicDowncast<const DepthToSpaceLayer*>(&layer); |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 230 | |
| 231 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 232 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 233 | |
| 234 | result = layerSupportObject->IsDepthToSpaceSupported(OverrideDataType(input, dataType), |
| 235 | OverrideDataType(output, dataType), |
| 236 | cLayer->GetParameters(), |
| 237 | reason); |
| 238 | break; |
| 239 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 240 | case LayerType::DepthwiseConvolution2d: |
| 241 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 242 | auto cLayer = PolymorphicDowncast<const DepthwiseConvolution2dLayer*>(&layer); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 243 | const TensorInfo& input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 244 | dataType); |
| 245 | const TensorInfo& output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 246 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 247 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 248 | const DepthwiseConvolution2dDescriptor& descriptor = cLayer->GetParameters(); |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 249 | |
| 250 | // Construct optional biases object based on the value of m_BiasEnabled |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 251 | Optional<TensorInfo> biases; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 252 | if (descriptor.m_BiasEnabled) |
| 253 | { |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 254 | biases = |
| 255 | OverrideDataType(cLayer->m_Bias->GetTensorInfo(), GetBiasTypeFromWeightsType(dataType)); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 256 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 257 | |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 258 | result = layerSupportObject->IsDepthwiseConvolutionSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 259 | input, |
| 260 | output, |
| 261 | descriptor, |
| 262 | OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType), |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 263 | biases, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 264 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 265 | break; |
| 266 | } |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 267 | case LayerType::Dequantize: |
| 268 | { |
| 269 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 270 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 271 | |
Aron Virginas-Tar | 87972be | 2019-11-13 15:16:28 +0000 | [diff] [blame] | 272 | result = layerSupportObject->IsDequantizeSupported(input, |
| 273 | OverrideDataType(output, dataType), |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 274 | reason); |
| 275 | break; |
| 276 | } |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 277 | case LayerType::DetectionPostProcess: |
| 278 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 279 | auto cLayer = PolymorphicDowncast<const DetectionPostProcessLayer*>(&layer); |
Derek Lamberti | 6a5e5e8 | 2019-12-05 14:41:20 +0000 | [diff] [blame] | 280 | const TensorInfo& boxEncodings = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 281 | const TensorInfo& scores = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 282 | const TensorInfo& anchors = cLayer->m_Anchors->GetTensorInfo(); |
| 283 | |
| 284 | const TensorInfo& detectionBoxes = layer.GetOutputSlot(0).GetTensorInfo(); |
| 285 | const TensorInfo& detectionClasses = layer.GetOutputSlot(1).GetTensorInfo(); |
| 286 | const TensorInfo& detectionScores = layer.GetOutputSlot(2).GetTensorInfo(); |
| 287 | const TensorInfo& numDetections = layer.GetOutputSlot(3).GetTensorInfo(); |
| 288 | |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 289 | const DetectionPostProcessDescriptor& descriptor = cLayer->GetParameters(); |
Derek Lamberti | 6a5e5e8 | 2019-12-05 14:41:20 +0000 | [diff] [blame] | 290 | result = layerSupportObject->IsDetectionPostProcessSupported(boxEncodings, |
| 291 | scores, |
| 292 | anchors, |
| 293 | detectionBoxes, |
| 294 | detectionClasses, |
| 295 | detectionScores, |
| 296 | numDetections, |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 297 | descriptor, |
| 298 | reason); |
| 299 | break; |
| 300 | } |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 301 | case LayerType::ElementwiseUnary: |
| 302 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 303 | auto cLayer = PolymorphicDowncast<const ElementwiseUnaryLayer*>(&layer); |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 304 | |
| 305 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 306 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 307 | |
| 308 | result = layerSupportObject->IsElementwiseUnarySupported(OverrideDataType(input, dataType), |
| 309 | OverrideDataType(output, dataType), |
| 310 | cLayer->GetParameters(), |
| 311 | reason); |
| 312 | break; |
| 313 | } |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 314 | case LayerType::Fill: |
| 315 | { |
| 316 | auto cLayer = PolymorphicDowncast<const FillLayer*>(&layer); |
| 317 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 318 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 319 | const FillDescriptor& descriptor = cLayer->GetParameters(); |
| 320 | |
| 321 | result = layerSupportObject->IsFillSupported( |
| 322 | OverrideDataType(input, dataType), |
| 323 | OverrideDataType(output, dataType), |
| 324 | descriptor, |
| 325 | reason); |
| 326 | break; |
| 327 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 328 | case LayerType::FakeQuantization: |
| 329 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 330 | auto cLayer = PolymorphicDowncast<const FakeQuantizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 331 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 332 | result = layerSupportObject->IsFakeQuantizationSupported(OverrideDataType(input, dataType), |
| 333 | cLayer->GetParameters(), |
| 334 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 335 | break; |
| 336 | } |
| 337 | case LayerType::Floor: |
| 338 | { |
| 339 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 340 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 341 | result = layerSupportObject->IsFloorSupported(OverrideDataType(input, dataType), |
| 342 | OverrideDataType(output, dataType), |
| 343 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 344 | break; |
| 345 | } |
| 346 | case LayerType::FullyConnected: |
| 347 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 348 | auto cLayer = PolymorphicDowncast<const FullyConnectedLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 349 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 350 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 351 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 352 | |
| 353 | TensorInfo biasInfo; |
| 354 | const TensorInfo * biasInfoPtr = nullptr; |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 355 | static const TensorInfo dummyBFloat16Bias(TensorShape({1,1,1,1}), DataType::BFloat16); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 356 | static const TensorInfo dummyFloat16Bias(TensorShape({1,1,1,1}), DataType::Float16); |
| 357 | static const TensorInfo dummyFloat32Bias(TensorShape({1,1,1,1}), DataType::Float32); |
| 358 | static const TensorInfo dummyQA8Bias(TensorShape({1,1,1,1}), DataType::Signed32); |
| 359 | |
| 360 | const FullyConnectedDescriptor& descriptor = cLayer->GetParameters(); |
| 361 | if (descriptor.m_BiasEnabled) |
| 362 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 363 | ARMNN_ASSERT(cLayer->m_Bias.get() != nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 364 | biasInfo = OverrideDataType(cLayer->m_Bias->GetTensorInfo(), GetBiasTypeFromWeightsType(dataType)); |
| 365 | biasInfoPtr = &biasInfo; |
| 366 | } |
| 367 | else |
| 368 | { |
| 369 | // If biases are not enabled pass a dummy tensorinfo for the validation |
| 370 | switch(input.GetDataType()) |
| 371 | { |
Narumol Prangnawarat | 44179c3 | 2020-03-11 14:51:27 +0000 | [diff] [blame] | 372 | case DataType::BFloat16: |
| 373 | { |
| 374 | biasInfoPtr = &dummyBFloat16Bias; |
| 375 | break; |
| 376 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 377 | case DataType::Float16: |
| 378 | { |
| 379 | biasInfoPtr = &dummyFloat16Bias; |
| 380 | break; |
| 381 | } |
| 382 | case DataType::Float32: |
| 383 | { |
| 384 | biasInfoPtr = &dummyFloat32Bias; |
| 385 | break; |
| 386 | } |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 387 | case DataType::QAsymmU8: |
Keith Davis | a856501 | 2020-02-14 12:22:40 +0000 | [diff] [blame] | 388 | case DataType::QAsymmS8: |
Keith Davis | 9d0ff74 | 2020-02-03 14:47:54 +0000 | [diff] [blame] | 389 | case DataType::QSymmS8: |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 390 | case DataType::QSymmS16: |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 391 | { |
| 392 | biasInfoPtr = &dummyQA8Bias; |
| 393 | break; |
| 394 | } |
| 395 | default: |
| 396 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 397 | ARMNN_ASSERT_MSG(false, "Unexpected bias type"); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 398 | } |
| 399 | } |
| 400 | } |
| 401 | |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 402 | result = layerSupportObject->IsFullyConnectedSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 403 | OverrideDataType(input, dataType), |
| 404 | OverrideDataType(output, dataType), |
| 405 | OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType), |
| 406 | *biasInfoPtr, |
| 407 | descriptor, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 408 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 409 | break; |
| 410 | } |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 411 | case LayerType::Gather: |
| 412 | { |
| 413 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 414 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 415 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 416 | auto cLayer = PolymorphicDowncast<const GatherLayer*>(&layer); |
| 417 | const GatherDescriptor& descriptor = cLayer->GetParameters(); |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 418 | result = layerSupportObject->IsGatherSupported(OverrideDataType(input0, dataType), |
Ellen Norris-Thompson | e0dbedf | 2019-06-24 09:23:38 +0100 | [diff] [blame] | 419 | input1, |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 420 | OverrideDataType(output, dataType), |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 421 | descriptor, |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 422 | reason); |
| 423 | break; |
| 424 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 425 | case LayerType::Input: |
| 426 | { |
| 427 | const TensorInfo& input = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 428 | result = layerSupportObject->IsInputSupported(OverrideDataType(input, dataType), reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 429 | break; |
| 430 | } |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 431 | case LayerType::InstanceNormalization: |
| 432 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 433 | auto cLayer = PolymorphicDowncast<const InstanceNormalizationLayer*>(&layer); |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 434 | const InstanceNormalizationDescriptor& descriptor = cLayer->GetParameters(); |
| 435 | |
| 436 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 437 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 438 | |
| 439 | result = layerSupportObject->IsInstanceNormalizationSupported( |
| 440 | OverrideDataType(input, dataType), |
| 441 | OverrideDataType(output, dataType), |
| 442 | descriptor, |
| 443 | reason); |
| 444 | break; |
| 445 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 446 | case LayerType::L2Normalization: |
| 447 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 448 | auto cLayer = PolymorphicDowncast<const L2NormalizationLayer*>(&layer); |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 449 | const L2NormalizationDescriptor& descriptor = cLayer->GetParameters(); |
| 450 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 451 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 452 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 453 | |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 454 | result = layerSupportObject->IsL2NormalizationSupported( |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 455 | OverrideDataType(input, dataType), |
| 456 | OverrideDataType(output, dataType), |
| 457 | descriptor, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 458 | reason); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 459 | break; |
| 460 | } |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 461 | case LayerType::LogSoftmax: |
| 462 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 463 | auto cLayer = PolymorphicDowncast<const LogSoftmaxLayer*>(&layer); |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 464 | |
| 465 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 466 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 467 | |
| 468 | result = layerSupportObject->IsLogSoftmaxSupported(OverrideDataType(input, dataType), |
| 469 | OverrideDataType(output, dataType), |
| 470 | cLayer->GetParameters(), |
| 471 | reason); |
| 472 | break; |
| 473 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 474 | case LayerType::Lstm: |
| 475 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 476 | auto cLayer = PolymorphicDowncast<const LstmLayer*>(&layer); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 477 | const LstmDescriptor& descriptor = cLayer->GetParameters(); |
| 478 | |
| 479 | // All inputs. |
| 480 | const TensorInfo& input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 481 | dataType); |
| 482 | const TensorInfo& outputStateIn = OverrideDataType(layer.GetInputSlot(1).GetConnection()->GetTensorInfo(), |
| 483 | dataType); |
| 484 | const TensorInfo& cellStateIn = OverrideDataType(layer.GetInputSlot(2).GetConnection()->GetTensorInfo(), |
| 485 | dataType); |
| 486 | // All outputs |
| 487 | const TensorInfo& scratchBuffer = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 488 | const TensorInfo& outputStateOut = OverrideDataType(layer.GetOutputSlot(1).GetTensorInfo(), dataType); |
| 489 | const TensorInfo& cellStateOut = OverrideDataType(layer.GetOutputSlot(2).GetTensorInfo(), dataType); |
| 490 | const TensorInfo& output = OverrideDataType(layer.GetOutputSlot(3).GetTensorInfo(), dataType); |
| 491 | |
| 492 | // Basic parameters |
| 493 | const TensorInfo& inputToForgetWeights |
| 494 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToForgetWeights->GetTensorInfo(), dataType); |
| 495 | const TensorInfo& inputToCellWeights |
| 496 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToCellWeights->GetTensorInfo(), dataType); |
| 497 | const TensorInfo& inputToOutputWeights |
| 498 | = OverrideDataType(cLayer->m_BasicParameters.m_InputToOutputWeights->GetTensorInfo(), dataType); |
| 499 | const TensorInfo& recurrentToForgetWeights |
| 500 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToForgetWeights->GetTensorInfo(), dataType); |
| 501 | const TensorInfo& recurrentToCellWeights |
| 502 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToCellWeights->GetTensorInfo(), dataType); |
| 503 | const TensorInfo& recurrentToOutputWeights |
| 504 | = OverrideDataType(cLayer->m_BasicParameters.m_RecurrentToOutputWeights->GetTensorInfo(), dataType); |
| 505 | const TensorInfo& forgetGateBias |
| 506 | = OverrideDataType(cLayer->m_BasicParameters.m_ForgetGateBias->GetTensorInfo(), dataType); |
| 507 | const TensorInfo& cellBias |
| 508 | = OverrideDataType(cLayer->m_BasicParameters.m_CellBias->GetTensorInfo(), dataType); |
| 509 | const TensorInfo& outputGateBias |
| 510 | = OverrideDataType(cLayer->m_BasicParameters.m_OutputGateBias->GetTensorInfo(), dataType); |
| 511 | |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 512 | LstmInputParamsInfo paramsInfo; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 513 | |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 514 | paramsInfo.m_InputToForgetWeights = &inputToForgetWeights; |
| 515 | paramsInfo.m_InputToCellWeights = &inputToCellWeights; |
| 516 | paramsInfo.m_InputToOutputWeights = &inputToOutputWeights; |
| 517 | paramsInfo.m_RecurrentToForgetWeights = &recurrentToForgetWeights; |
| 518 | paramsInfo.m_RecurrentToCellWeights = &recurrentToCellWeights; |
| 519 | paramsInfo.m_RecurrentToOutputWeights = &recurrentToOutputWeights; |
| 520 | paramsInfo.m_ForgetGateBias = &forgetGateBias; |
| 521 | paramsInfo.m_CellBias = &cellBias; |
| 522 | paramsInfo.m_OutputGateBias = &outputGateBias; |
| 523 | |
| 524 | |
| 525 | // Optional parameters |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 526 | TensorInfo optInputToInputWeights; |
| 527 | TensorInfo optRecurrentToInputWeights; |
| 528 | TensorInfo optCellToInputWeights; |
| 529 | TensorInfo optInputGateBias; |
| 530 | TensorInfo optProjectionWeights; |
| 531 | TensorInfo optProjectionBias; |
| 532 | TensorInfo optCellToForgetWeights; |
| 533 | TensorInfo optCellToOutputWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 534 | TensorInfo optInputLayerNormWeights; |
| 535 | TensorInfo optForgetLayerNormWeights; |
| 536 | TensorInfo optCellLayerNormWeights; |
| 537 | TensorInfo optOutputLayerNormWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 538 | |
| 539 | if(!descriptor.m_CifgEnabled) |
| 540 | { |
| 541 | optInputToInputWeights = |
| 542 | OverrideDataType(cLayer->m_CifgParameters.m_InputToInputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 543 | paramsInfo.m_InputToInputWeights = &optInputToInputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 544 | |
| 545 | optRecurrentToInputWeights = |
| 546 | OverrideDataType(cLayer->m_CifgParameters.m_RecurrentToInputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 547 | paramsInfo.m_RecurrentToInputWeights = &optRecurrentToInputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 548 | optInputGateBias = |
| 549 | OverrideDataType(cLayer->m_CifgParameters.m_InputGateBias->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 550 | paramsInfo.m_InputGateBias = &optInputGateBias; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 551 | } |
| 552 | |
| 553 | if(descriptor.m_ProjectionEnabled) |
| 554 | { |
| 555 | optProjectionWeights = |
| 556 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 557 | paramsInfo.m_ProjectionWeights = &optProjectionWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 558 | if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr) |
| 559 | { |
| 560 | optProjectionBias = |
| 561 | OverrideDataType(cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 562 | paramsInfo.m_ProjectionBias = &optProjectionBias; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 563 | } |
| 564 | } |
| 565 | |
| 566 | if(descriptor.m_PeepholeEnabled) |
| 567 | { |
Jan Eilers | e2062cd | 2020-03-30 15:07:45 +0100 | [diff] [blame] | 568 | if(!descriptor.m_CifgEnabled) |
| 569 | { |
| 570 | optCellToInputWeights = |
| 571 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToInputWeights->GetTensorInfo(), |
| 572 | dataType); |
| 573 | paramsInfo.m_CellToInputWeights = &optCellToInputWeights; |
| 574 | } |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 575 | optCellToForgetWeights = |
| 576 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToForgetWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 577 | paramsInfo.m_CellToForgetWeights = &optCellToForgetWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 578 | optCellToOutputWeights = |
| 579 | OverrideDataType(cLayer->m_PeepholeParameters.m_CellToOutputWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 580 | paramsInfo.m_CellToOutputWeights = &optCellToOutputWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 581 | } |
| 582 | |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 583 | if(descriptor.m_LayerNormEnabled) |
| 584 | { |
Ferran Balaguer | e30c16e | 2019-07-24 17:03:45 +0100 | [diff] [blame] | 585 | if (!descriptor.m_CifgEnabled) |
| 586 | { |
| 587 | optInputLayerNormWeights = OverrideDataType( |
| 588 | cLayer->m_LayerNormParameters.m_InputLayerNormWeights->GetTensorInfo(), dataType); |
| 589 | paramsInfo.m_InputLayerNormWeights = &optInputLayerNormWeights; |
| 590 | } |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 591 | |
| 592 | optForgetLayerNormWeights = OverrideDataType( |
| 593 | cLayer->m_LayerNormParameters.m_ForgetLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 594 | paramsInfo.m_ForgetLayerNormWeights = &optForgetLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 595 | |
| 596 | optCellLayerNormWeights = OverrideDataType( |
| 597 | cLayer->m_LayerNormParameters.m_CellLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 598 | paramsInfo.m_CellLayerNormWeights = &optCellLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 599 | |
| 600 | optOutputLayerNormWeights = OverrideDataType( |
| 601 | cLayer->m_LayerNormParameters.m_OutputLayerNormWeights->GetTensorInfo(), dataType); |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 602 | paramsInfo.m_OutputLayerNormWeights = &optOutputLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 603 | } |
| 604 | |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 605 | result = layerSupportObject->IsLstmSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 606 | input, |
| 607 | outputStateIn, |
| 608 | cellStateIn, |
| 609 | scratchBuffer, |
| 610 | outputStateOut, |
| 611 | cellStateOut, |
| 612 | output, |
| 613 | descriptor, |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 614 | paramsInfo, |
| 615 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 616 | break; |
| 617 | } |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 618 | case LayerType::Maximum: |
| 619 | { |
| 620 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 621 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 622 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 623 | |
| 624 | result = layerSupportObject->IsMaximumSupported(OverrideDataType(input0, dataType), |
| 625 | OverrideDataType(input1, dataType), |
| 626 | OverrideDataType(output, dataType), |
| 627 | reason); |
| 628 | break; |
| 629 | } |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 630 | case LayerType::MemCopy: |
| 631 | { |
| 632 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 633 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 634 | |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 635 | result = layerSupportObject->IsMemCopySupported(OverrideDataType(input, dataType), |
| 636 | OverrideDataType(output, dataType), |
| 637 | reason); |
| 638 | break; |
| 639 | } |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 640 | case LayerType::MemImport: |
| 641 | { |
| 642 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 643 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 644 | |
| 645 | result = layerSupportObject->IsMemImportSupported(OverrideDataType(input, dataType), |
| 646 | OverrideDataType(output, dataType), |
| 647 | reason); |
| 648 | break; |
| 649 | } |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 650 | case LayerType::Merge: |
| 651 | { |
| 652 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 653 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 654 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 655 | |
| 656 | result = layerSupportObject->IsMergeSupported(OverrideDataType(input0, dataType), |
| 657 | OverrideDataType(input1, dataType), |
| 658 | OverrideDataType(output, dataType), |
| 659 | reason); |
| 660 | break; |
| 661 | } |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 662 | case LayerType::Concat: |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 663 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 664 | auto cLayer = PolymorphicDowncast<const ConcatLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 665 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 666 | // Get vector of all inputs. |
| 667 | auto getTensorInfo = [&dataType](const InputSlot& slot) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 668 | { |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 669 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 670 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 671 | |
| 672 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfo); |
| 673 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfo); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 674 | std::vector<TensorInfo> inputs(beginI, endI); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 675 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 676 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 677 | { |
| 678 | return &info; |
| 679 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 680 | |
| 681 | auto beginPtr = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 682 | auto endPtr = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 683 | std::vector<const TensorInfo*> inputPtrs(beginPtr, endPtr); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 684 | |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 685 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 686 | |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 687 | result = layerSupportObject->IsConcatSupported(inputPtrs, output, cLayer->GetParameters(), reason); |
| 688 | |
| 689 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 690 | break; |
| 691 | } |
| 692 | case LayerType::Multiplication: |
| 693 | { |
| 694 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 695 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 696 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 697 | result = layerSupportObject->IsMultiplicationSupported( |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 698 | OverrideDataType(input0, dataType), |
| 699 | OverrideDataType(input1, dataType), |
| 700 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 701 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 702 | break; |
| 703 | } |
| 704 | case LayerType::Normalization: |
| 705 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 706 | auto cLayer = PolymorphicDowncast<const NormalizationLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 707 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 708 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 709 | result = layerSupportObject->IsNormalizationSupported(OverrideDataType(input, dataType), |
| 710 | OverrideDataType(output, dataType), |
| 711 | cLayer->GetParameters(), |
| 712 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 713 | break; |
| 714 | } |
| 715 | case LayerType::Output: |
| 716 | { |
| 717 | const TensorInfo& output = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 718 | result = layerSupportObject->IsOutputSupported(OverrideDataType(output, dataType), reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 719 | break; |
| 720 | } |
| 721 | case LayerType::Permute: |
| 722 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 723 | auto cLayer = PolymorphicDowncast<const PermuteLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 724 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 725 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 726 | result = layerSupportObject->IsPermuteSupported(OverrideDataType(input, dataType), |
| 727 | OverrideDataType(output, dataType), |
| 728 | cLayer->GetParameters(), |
| 729 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 730 | break; |
| 731 | } |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 732 | case LayerType::Pad: |
| 733 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 734 | auto cLayer = PolymorphicDowncast<const PadLayer*>(&layer); |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 735 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 736 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 737 | result = layerSupportObject->IsPadSupported( |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 738 | OverrideDataType(input, dataType), |
| 739 | OverrideDataType(output, dataType), |
| 740 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 741 | reason); |
Mohamed Nour Abouelseoud | 5662c20 | 2018-09-24 13:30:09 +0100 | [diff] [blame] | 742 | break; |
| 743 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 744 | case LayerType::Pooling2d: |
| 745 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 746 | auto cLayer = PolymorphicDowncast<const Pooling2dLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 747 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 748 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 749 | result = layerSupportObject->IsPooling2dSupported(OverrideDataType(input, dataType), |
| 750 | OverrideDataType(output, dataType), |
| 751 | cLayer->GetParameters(), |
| 752 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 753 | break; |
| 754 | } |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 755 | case LayerType::PreCompiled: |
| 756 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 757 | auto cLayer = PolymorphicDowncast<const PreCompiledLayer*>(&layer); |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 758 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 759 | result = layerSupportObject->IsPreCompiledSupported(OverrideDataType(input, dataType), |
| 760 | cLayer->GetParameters(), |
| 761 | reason); |
| 762 | break; |
| 763 | } |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 764 | case LayerType::Quantize: |
| 765 | { |
| 766 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 767 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 768 | result = layerSupportObject->IsQuantizeSupported(input, output, reason); |
| 769 | break; |
| 770 | } |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 771 | case LayerType::QLstm: |
| 772 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 773 | auto cLayer = PolymorphicDowncast<const QLstmLayer*>(&layer); |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 774 | const QLstmDescriptor& descriptor = cLayer->GetParameters(); |
| 775 | |
| 776 | // Inputs |
| 777 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 778 | const TensorInfo& previousOutputIn = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 779 | const TensorInfo& previousCellStateIn = layer.GetInputSlot(2).GetConnection()->GetTensorInfo(); |
| 780 | |
| 781 | // Outputs |
| 782 | const TensorInfo& outputStateOut = layer.GetOutputSlot(0).GetTensorInfo(); |
| 783 | const TensorInfo& cellStateOut = layer.GetOutputSlot(1).GetTensorInfo(); |
| 784 | const TensorInfo& output = layer.GetOutputSlot(2).GetTensorInfo(); |
| 785 | |
| 786 | // Lstm parameters |
| 787 | LstmInputParamsInfo paramsInfo; |
| 788 | |
| 789 | // Basic parameters |
| 790 | paramsInfo.m_InputToForgetWeights = &cLayer->m_BasicParameters.m_InputToForgetWeights->GetTensorInfo(); |
| 791 | paramsInfo.m_InputToCellWeights = &cLayer->m_BasicParameters.m_InputToCellWeights->GetTensorInfo(); |
| 792 | paramsInfo.m_InputToOutputWeights = &cLayer->m_BasicParameters.m_InputToOutputWeights->GetTensorInfo(); |
| 793 | |
| 794 | paramsInfo.m_RecurrentToForgetWeights = |
| 795 | &cLayer->m_BasicParameters.m_RecurrentToForgetWeights->GetTensorInfo(); |
| 796 | paramsInfo.m_RecurrentToCellWeights = |
| 797 | &cLayer->m_BasicParameters.m_RecurrentToCellWeights->GetTensorInfo(); |
| 798 | paramsInfo.m_RecurrentToOutputWeights = |
| 799 | &cLayer->m_BasicParameters.m_RecurrentToOutputWeights->GetTensorInfo(); |
| 800 | |
| 801 | paramsInfo.m_ForgetGateBias = &cLayer->m_BasicParameters.m_ForgetGateBias->GetTensorInfo(); |
| 802 | paramsInfo.m_CellBias = &cLayer->m_BasicParameters.m_CellBias->GetTensorInfo(); |
| 803 | paramsInfo.m_OutputGateBias = &cLayer->m_BasicParameters.m_OutputGateBias->GetTensorInfo(); |
| 804 | |
| 805 | if(!descriptor.m_CifgEnabled) |
| 806 | { |
| 807 | paramsInfo.m_InputToInputWeights = &cLayer->m_CifgParameters.m_InputToInputWeights->GetTensorInfo(); |
| 808 | paramsInfo.m_RecurrentToInputWeights = |
| 809 | &cLayer->m_CifgParameters.m_RecurrentToInputWeights->GetTensorInfo(); |
| 810 | paramsInfo.m_InputGateBias = &cLayer->m_CifgParameters.m_InputGateBias->GetTensorInfo(); |
| 811 | } |
| 812 | |
| 813 | if(descriptor.m_ProjectionEnabled) |
| 814 | { |
| 815 | paramsInfo.m_ProjectionWeights = &cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo(); |
James Conroy | ed32405 | 2020-05-18 15:16:42 +0100 | [diff] [blame] | 816 | |
| 817 | // Projection bias is optional even if projection is enabled |
| 818 | if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr) |
| 819 | { |
| 820 | paramsInfo.m_ProjectionBias = &cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo(); |
| 821 | } |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 822 | } |
| 823 | |
| 824 | if(descriptor.m_PeepholeEnabled) |
| 825 | { |
| 826 | if (!descriptor.m_CifgEnabled) |
| 827 | { |
| 828 | paramsInfo.m_CellToInputWeights = |
| 829 | &cLayer->m_PeepholeParameters.m_CellToInputWeights->GetTensorInfo(); |
| 830 | } |
| 831 | |
| 832 | paramsInfo.m_CellToForgetWeights = |
| 833 | &cLayer->m_PeepholeParameters.m_CellToForgetWeights->GetTensorInfo(); |
| 834 | paramsInfo.m_CellToOutputWeights = &cLayer->m_PeepholeParameters.m_CellToOutputWeights->GetTensorInfo(); |
| 835 | } |
| 836 | |
| 837 | if(descriptor.m_LayerNormEnabled) |
| 838 | { |
| 839 | if (!descriptor.m_CifgEnabled) |
| 840 | { |
| 841 | paramsInfo.m_InputLayerNormWeights = |
| 842 | &cLayer->m_LayerNormParameters.m_InputLayerNormWeights->GetTensorInfo(); |
| 843 | } |
| 844 | |
| 845 | paramsInfo.m_ForgetLayerNormWeights = |
| 846 | &cLayer->m_LayerNormParameters.m_ForgetLayerNormWeights->GetTensorInfo(); |
| 847 | paramsInfo.m_CellLayerNormWeights = |
| 848 | &cLayer->m_LayerNormParameters.m_CellLayerNormWeights->GetTensorInfo(); |
| 849 | paramsInfo.m_OutputLayerNormWeights = |
| 850 | &cLayer->m_LayerNormParameters.m_OutputLayerNormWeights->GetTensorInfo(); |
| 851 | } |
| 852 | |
| 853 | result = layerSupportObject->IsQLstmSupported(input, |
| 854 | previousOutputIn, |
| 855 | previousCellStateIn, |
| 856 | outputStateOut, |
| 857 | cellStateOut, |
| 858 | output, |
| 859 | descriptor, |
| 860 | paramsInfo, |
| 861 | reason); |
| 862 | break; |
| 863 | } |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 864 | case LayerType::QuantizedLstm: |
| 865 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 866 | auto cLayer = PolymorphicDowncast<const QuantizedLstmLayer*>(&layer); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 867 | |
| 868 | // Inputs |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 869 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 870 | const TensorInfo& previousCellStateIn = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 871 | const TensorInfo& previousOutputIn = layer.GetInputSlot(2).GetConnection()->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 872 | |
| 873 | // Outputs |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 874 | const TensorInfo& cellStateOut = layer.GetOutputSlot(0).GetTensorInfo(); |
| 875 | const TensorInfo& output = layer.GetOutputSlot(1).GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 876 | |
| 877 | // QuantizedLstm parameters |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 878 | QuantizedLstmInputParamsInfo paramsInfo; |
| 879 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 880 | paramsInfo.m_InputToInputWeights = |
| 881 | &cLayer->m_QuantizedLstmParameters.m_InputToInputWeights->GetTensorInfo(); |
| 882 | paramsInfo.m_InputToForgetWeights = |
| 883 | &cLayer->m_QuantizedLstmParameters.m_InputToForgetWeights->GetTensorInfo(); |
| 884 | paramsInfo.m_InputToCellWeights = |
| 885 | &cLayer->m_QuantizedLstmParameters.m_InputToCellWeights->GetTensorInfo(); |
| 886 | paramsInfo.m_InputToOutputWeights = |
| 887 | &cLayer->m_QuantizedLstmParameters.m_InputToOutputWeights->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 888 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 889 | paramsInfo.m_RecurrentToInputWeights = |
| 890 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToInputWeights->GetTensorInfo(); |
| 891 | paramsInfo.m_RecurrentToForgetWeights = |
| 892 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToForgetWeights->GetTensorInfo(); |
| 893 | paramsInfo.m_RecurrentToCellWeights = |
| 894 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToCellWeights->GetTensorInfo(); |
| 895 | paramsInfo.m_RecurrentToOutputWeights = |
| 896 | &cLayer->m_QuantizedLstmParameters.m_RecurrentToOutputWeights->GetTensorInfo(); |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 897 | |
Ferran Balaguer | 737d9ff | 2019-08-01 09:58:08 +0100 | [diff] [blame] | 898 | paramsInfo.m_InputGateBias = |
| 899 | &cLayer->m_QuantizedLstmParameters.m_InputGateBias->GetTensorInfo(); |
| 900 | paramsInfo.m_ForgetGateBias = |
| 901 | &cLayer->m_QuantizedLstmParameters.m_ForgetGateBias->GetTensorInfo(); |
| 902 | paramsInfo.m_CellBias = |
| 903 | &cLayer->m_QuantizedLstmParameters.m_CellBias->GetTensorInfo(); |
| 904 | paramsInfo.m_OutputGateBias = |
| 905 | &cLayer->m_QuantizedLstmParameters.m_OutputGateBias->GetTensorInfo();; |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 906 | |
| 907 | result = layerSupportObject->IsQuantizedLstmSupported(input, |
| 908 | previousCellStateIn, |
| 909 | previousOutputIn, |
| 910 | cellStateOut, |
| 911 | output, |
| 912 | paramsInfo, |
| 913 | reason); |
| 914 | break; |
| 915 | } |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 916 | case LayerType::Division: |
| 917 | { |
| 918 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 919 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 920 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 921 | result = layerSupportObject->IsDivisionSupported( |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 922 | OverrideDataType(input0, dataType), |
| 923 | OverrideDataType(input1, dataType), |
| 924 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 925 | reason); |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 926 | break; |
| 927 | } |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 928 | case LayerType::Rank: |
| 929 | { |
| 930 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 931 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 932 | result = layerSupportObject->IsRankSupported(OverrideDataType(input, dataType), |
| 933 | OverrideDataType(output, dataType), |
| 934 | reason); |
| 935 | break; |
| 936 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 937 | case LayerType::Reshape: |
| 938 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 939 | auto cLayer = PolymorphicDowncast<const ReshapeLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 940 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 941 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 942 | result = layerSupportObject->IsReshapeSupported(OverrideDataType(input, dataType), |
Kevin May | a023c40 | 2019-12-12 17:28:05 +0000 | [diff] [blame] | 943 | OverrideDataType(output, dataType), |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 944 | cLayer->GetParameters(), |
| 945 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 946 | break; |
| 947 | } |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 948 | case LayerType::Resize: |
| 949 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 950 | auto cLayer = PolymorphicDowncast<const ResizeLayer*>(&layer); |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 951 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 952 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 953 | result = layerSupportObject->IsResizeSupported(OverrideDataType(input, dataType), |
| 954 | OverrideDataType(output, dataType), |
| 955 | cLayer->GetParameters(), |
| 956 | reason); |
| 957 | break; |
| 958 | } |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 959 | case LayerType::Slice: |
| 960 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 961 | auto cLayer = PolymorphicDowncast<const SliceLayer*>(&layer); |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 962 | |
| 963 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 964 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 965 | |
| 966 | result = layerSupportObject->IsSliceSupported(OverrideDataType(input, dataType), |
| 967 | OverrideDataType(output, dataType), |
| 968 | cLayer->GetParameters(), |
| 969 | reason); |
| 970 | break; |
| 971 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 972 | case LayerType::Softmax: |
| 973 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 974 | auto cLayer = PolymorphicDowncast<const SoftmaxLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 975 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 976 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 977 | result = layerSupportObject->IsSoftmaxSupported(OverrideDataType(input, dataType), |
| 978 | OverrideDataType(output, dataType), |
| 979 | cLayer->GetParameters(), |
| 980 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 981 | break; |
| 982 | } |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 983 | case LayerType::SpaceToBatchNd: |
| 984 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 985 | auto cLayer = PolymorphicDowncast<const SpaceToBatchNdLayer*>(&layer); |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 986 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 987 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 988 | result = layerSupportObject->IsSpaceToBatchNdSupported(OverrideDataType(input, dataType), |
| 989 | OverrideDataType(output, dataType), |
| 990 | cLayer->GetParameters(), |
| 991 | reason); |
| 992 | break; |
| 993 | } |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 994 | case LayerType::SpaceToDepth: |
| 995 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 996 | auto cLayer = PolymorphicDowncast<const SpaceToDepthLayer*>(&layer); |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 997 | |
| 998 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 999 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1000 | |
| 1001 | result = layerSupportObject->IsSpaceToDepthSupported(OverrideDataType(input, dataType), |
| 1002 | OverrideDataType(output, dataType), |
| 1003 | cLayer->GetParameters(), |
| 1004 | reason); |
| 1005 | break; |
| 1006 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1007 | case LayerType::Splitter: |
| 1008 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1009 | auto cLayer = PolymorphicDowncast<const SplitterLayer*>(&layer); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1010 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1011 | |
| 1012 | // Get vector of all outputs. |
| 1013 | auto getTensorInfo = [&dataType](const OutputSlot& slot) |
| 1014 | { |
| 1015 | return OverrideDataType(slot.GetTensorInfo(), dataType); |
| 1016 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1017 | auto beginI = MakeTransformIterator(layer.GetOutputSlots().begin(), getTensorInfo); |
| 1018 | auto endI = MakeTransformIterator(layer.GetOutputSlots().end(), getTensorInfo); |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1019 | std::vector<TensorInfo> outputs(beginI, endI); |
| 1020 | |
| 1021 | const std::vector<std::reference_wrapper<TensorInfo>> outputPtrs(outputs.begin(), outputs.end()); |
| 1022 | |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1023 | result = layerSupportObject->IsSplitterSupported(OverrideDataType(input, dataType), |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 1024 | outputPtrs, |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1025 | cLayer->GetParameters(), |
| 1026 | reason); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1027 | break; |
| 1028 | } |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1029 | case LayerType::Stack: |
| 1030 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1031 | auto cLayer = PolymorphicDowncast<const StackLayer*>(&layer); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1032 | |
| 1033 | // Get vector of all inputs. |
| 1034 | auto getTensorInfo = [&dataType](const InputSlot& slot) |
| 1035 | { |
| 1036 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
| 1037 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1038 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfo); |
| 1039 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfo); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1040 | std::vector<TensorInfo> inputs(beginI, endI); |
| 1041 | |
| 1042 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 1043 | { |
| 1044 | return &info; |
| 1045 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1046 | auto beginPtr = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 1047 | auto endPtr = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1048 | std::vector<const TensorInfo*> inputPtrs(beginPtr, endPtr); |
| 1049 | |
| 1050 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1051 | |
| 1052 | result = layerSupportObject->IsStackSupported(inputPtrs, output, cLayer->GetParameters(), reason); |
| 1053 | |
| 1054 | break; |
| 1055 | } |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1056 | case LayerType::StandIn: |
| 1057 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1058 | auto cLayer = PolymorphicDowncast<const StandInLayer*>(&layer); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1059 | |
| 1060 | // Get vector of all inputs. |
| 1061 | auto getTensorInfoIn = [&dataType](const InputSlot& slot) |
| 1062 | { |
| 1063 | return OverrideDataType(slot.GetConnectedOutputSlot()->GetTensorInfo(), dataType); |
| 1064 | }; |
| 1065 | auto getTensorInfoOut = [&dataType](const OutputSlot& slot) |
| 1066 | { |
| 1067 | return OverrideDataType(slot.GetTensorInfo(), dataType); |
| 1068 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1069 | auto beginI = MakeTransformIterator(layer.GetInputSlots().begin(), getTensorInfoIn); |
| 1070 | auto endI = MakeTransformIterator(layer.GetInputSlots().end(), getTensorInfoIn); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1071 | std::vector<TensorInfo> inputs(beginI, endI); |
| 1072 | |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1073 | auto beginO = MakeTransformIterator(layer.GetOutputSlots().begin(), getTensorInfoOut); |
| 1074 | auto endO = MakeTransformIterator(layer.GetOutputSlots().end(), getTensorInfoOut); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1075 | std::vector<TensorInfo> outputs(beginO, endO); |
| 1076 | |
| 1077 | |
| 1078 | auto getTensorInfoPtr = [](const TensorInfo& info) |
| 1079 | { |
| 1080 | return &info; |
| 1081 | }; |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1082 | auto beginPtrI = MakeTransformIterator(inputs.begin(), getTensorInfoPtr); |
| 1083 | auto endPtrI = MakeTransformIterator(inputs.end(), getTensorInfoPtr); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1084 | std::vector<const TensorInfo*> inputPtrs(beginPtrI, endPtrI); |
| 1085 | |
Finn Williams | 3e54d03 | 2020-10-22 16:53:35 +0100 | [diff] [blame] | 1086 | auto beginPtrO = MakeTransformIterator(outputs.begin(), getTensorInfoPtr); |
| 1087 | auto endPtrO = MakeTransformIterator(outputs.end(), getTensorInfoPtr); |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 1088 | std::vector<const TensorInfo*> outputPtrs(beginPtrO, endPtrO); |
| 1089 | |
| 1090 | |
| 1091 | result = layerSupportObject->IsStandInSupported(inputPtrs, |
| 1092 | outputPtrs, |
| 1093 | cLayer->GetParameters(), |
| 1094 | reason); |
| 1095 | break; |
| 1096 | } |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1097 | case LayerType::StridedSlice: |
| 1098 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1099 | auto cLayer = PolymorphicDowncast<const StridedSliceLayer*>(&layer); |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 1100 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1101 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1102 | result = layerSupportObject->IsStridedSliceSupported(OverrideDataType(input, dataType), |
| 1103 | OverrideDataType(output, dataType), |
| 1104 | cLayer->GetParameters(), |
| 1105 | reason); |
| 1106 | break; |
| 1107 | } |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1108 | case LayerType::Subtraction: |
| 1109 | { |
| 1110 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1111 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1112 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1113 | result = layerSupportObject->IsSubtractionSupported( |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1114 | OverrideDataType(input0, dataType), |
| 1115 | OverrideDataType(input1, dataType), |
| 1116 | OverrideDataType(output, dataType), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1117 | reason); |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 1118 | break; |
| 1119 | } |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 1120 | case LayerType::Switch: |
| 1121 | { |
| 1122 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1123 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1124 | const TensorInfo& output0 = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1125 | const TensorInfo& output1 = layer.GetOutputSlot(1).GetTensorInfo(); |
| 1126 | result = layerSupportObject->IsSwitchSupported(OverrideDataType(input0, dataType), |
| 1127 | OverrideDataType(input1, dataType), |
| 1128 | OverrideDataType(output0, dataType), |
| 1129 | OverrideDataType(output1, dataType), |
| 1130 | reason); |
| 1131 | break; |
| 1132 | } |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1133 | case LayerType::Mean: |
| 1134 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1135 | auto cLayer = PolymorphicDowncast<const MeanLayer*>(&layer); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1136 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1137 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1138 | result = layerSupportObject->IsMeanSupported( |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1139 | OverrideDataType(input, dataType), |
| 1140 | OverrideDataType(output, dataType), |
| 1141 | cLayer->GetParameters(), |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1142 | reason); |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 1143 | break; |
| 1144 | } |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 1145 | case LayerType::Minimum: |
| 1146 | { |
| 1147 | const TensorInfo& input0 = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1148 | const TensorInfo& input1 = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1149 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1150 | result = layerSupportObject->IsMinimumSupported(OverrideDataType(input0, dataType), |
| 1151 | OverrideDataType(input1, dataType), |
| 1152 | OverrideDataType(output, dataType), |
| 1153 | reason); |
| 1154 | break; |
| 1155 | } |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 1156 | case LayerType::Prelu: |
| 1157 | { |
| 1158 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1159 | const TensorInfo& alpha = layer.GetInputSlot(1).GetConnection()->GetTensorInfo(); |
| 1160 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1161 | result = layerSupportObject->IsPreluSupported(OverrideDataType(input, dataType), |
| 1162 | OverrideDataType(alpha, dataType), |
| 1163 | OverrideDataType(output, dataType), |
| 1164 | reason); |
| 1165 | break; |
| 1166 | } |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1167 | case LayerType::Transpose: |
| 1168 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1169 | auto cLayer = PolymorphicDowncast<const TransposeLayer*>(&layer); |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1170 | const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo(); |
| 1171 | const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo(); |
| 1172 | result = layerSupportObject->IsTransposeSupported(OverrideDataType(input, dataType), |
| 1173 | OverrideDataType(output, dataType), |
| 1174 | cLayer->GetParameters(), |
| 1175 | reason); |
| 1176 | break; |
| 1177 | } |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1178 | case LayerType::TransposeConvolution2d: |
| 1179 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1180 | auto cLayer = PolymorphicDowncast<const TransposeConvolution2dLayer*>(&layer); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1181 | |
| 1182 | const TensorInfo input = OverrideDataType(layer.GetInputSlot(0).GetConnection()->GetTensorInfo(), |
| 1183 | dataType); |
| 1184 | const TensorInfo output = OverrideDataType(layer.GetOutputSlot(0).GetTensorInfo(), dataType); |
| 1185 | |
| 1186 | const TransposeConvolution2dDescriptor& descriptor = cLayer->GetParameters(); |
| 1187 | |
| 1188 | Optional<TensorInfo> biases; |
| 1189 | if (descriptor.m_BiasEnabled) |
| 1190 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1191 | ARMNN_ASSERT(cLayer->m_Bias.get() != nullptr); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1192 | biases = OverrideDataType(cLayer->m_Bias->GetTensorInfo(), |
| 1193 | GetBiasTypeFromWeightsType(dataType)); |
| 1194 | } |
| 1195 | |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1196 | ARMNN_ASSERT(cLayer->m_Weight.get() != nullptr); |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1197 | const TensorInfo weights = OverrideDataType(cLayer->m_Weight->GetTensorInfo(), dataType); |
| 1198 | |
| 1199 | result = layerSupportObject->IsTransposeConvolution2dSupported(input, |
| 1200 | output, |
| 1201 | descriptor, |
| 1202 | weights, |
| 1203 | biases, |
| 1204 | reason); |
| 1205 | |
| 1206 | break; |
| 1207 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1208 | default: |
| 1209 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 1210 | ARMNN_ASSERT_MSG(false, "WorkloadFactory did not recognise type of layer."); |
David Beck | 33f0ae0 | 2018-10-18 15:13:56 +0100 | [diff] [blame] | 1211 | reason.value() = "Unrecognised layer type"; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1212 | result = false; |
| 1213 | break; |
| 1214 | } |
| 1215 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1216 | return result; |
| 1217 | } |
| 1218 | |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 1219 | bool IWorkloadFactory::IsLayerSupported(const BackendId& backendId, |
| 1220 | const IConnectableLayer& connectableLayer, |
| 1221 | Optional<DataType> dataType, |
| 1222 | std::string& outReasonIfUnsupported) |
| 1223 | { |
| 1224 | return IsLayerConfigurationSupported(backendId, connectableLayer, dataType, outReasonIfUnsupported); |
| 1225 | } |
| 1226 | |
David Beck | dcb751f | 2018-10-03 11:42:42 +0100 | [diff] [blame] | 1227 | bool IWorkloadFactory::IsLayerSupported(const IConnectableLayer& connectableLayer, |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 1228 | Optional<DataType> dataType, |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1229 | std::string& outReasonIfUnsupported) |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1230 | { |
Jan Eilers | bb446e5 | 2020-04-02 13:56:54 +0100 | [diff] [blame] | 1231 | auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer); |
Sadik Armagan | 045f6be | 2020-09-10 13:37:32 +0100 | [diff] [blame] | 1232 | return IsLayerConfigurationSupported(layer->GetBackendId(), connectableLayer, dataType, outReasonIfUnsupported); |
| 1233 | } |
| 1234 | |
| 1235 | // TODO merge with defaulted modelOptions above |
| 1236 | bool IWorkloadFactory::IsLayerSupported(const IConnectableLayer& connectableLayer, |
| 1237 | Optional<DataType> dataType, |
| 1238 | std::string& outReasonIfUnsupported, |
| 1239 | const ModelOptions& modelOptions) |
| 1240 | { |
| 1241 | auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer); |
| 1242 | return IsLayerConfigurationSupported(layer->GetBackendId(), |
| 1243 | connectableLayer, |
| 1244 | dataType, |
| 1245 | outReasonIfUnsupported, |
| 1246 | modelOptions); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1247 | } |
| 1248 | |
Sadik Armagan | 04a7297 | 2020-09-14 15:44:18 +0100 | [diff] [blame] | 1249 | bool IWorkloadFactory::IsLayerSupported(const BackendId& backendId, |
| 1250 | const IConnectableLayer& connectableLayer, |
| 1251 | Optional<DataType> dataType, |
| 1252 | std::string& outReasonIfUnsupported, |
| 1253 | const ModelOptions& modelOptions) |
| 1254 | { |
| 1255 | return IsLayerConfigurationSupported(backendId, |
| 1256 | connectableLayer, |
| 1257 | dataType, |
| 1258 | outReasonIfUnsupported, |
| 1259 | modelOptions); |
| 1260 | } |
| 1261 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1262 | // Default Implementations |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1263 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateAbs(const AbsQueueDescriptor& /*descriptor*/, |
| 1264 | const WorkloadInfo& /*info*/) const |
Kevin May | 868eb14 | 2019-09-04 17:29:31 +0100 | [diff] [blame] | 1265 | { |
| 1266 | return std::unique_ptr<IWorkload>(); |
| 1267 | } |
| 1268 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1269 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateActivation(const ActivationQueueDescriptor& /*descriptor*/, |
| 1270 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1271 | { |
| 1272 | return std::unique_ptr<IWorkload>(); |
| 1273 | } |
| 1274 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1275 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateAddition(const AdditionQueueDescriptor& /*descriptor*/, |
| 1276 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1277 | { |
| 1278 | return std::unique_ptr<IWorkload>(); |
| 1279 | } |
| 1280 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1281 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateArgMinMax(const ArgMinMaxQueueDescriptor& /*descriptor*/, |
| 1282 | const WorkloadInfo& /*info*/) const |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 1283 | { |
| 1284 | return std::unique_ptr<IWorkload>(); |
| 1285 | } |
| 1286 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1287 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateBatchNormalization( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1288 | const BatchNormalizationQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1289 | { |
| 1290 | return std::unique_ptr<IWorkload>(); |
| 1291 | } |
| 1292 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1293 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateBatchToSpaceNd(const BatchToSpaceNdQueueDescriptor& /*desc*/, |
| 1294 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1295 | { |
| 1296 | return std::unique_ptr<IWorkload>(); |
| 1297 | } |
| 1298 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1299 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateComparison(const ComparisonQueueDescriptor& /*descriptor*/, |
| 1300 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 1301 | { |
| 1302 | return std::unique_ptr<IWorkload>(); |
| 1303 | } |
| 1304 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1305 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConcat(const ConcatQueueDescriptor& /*descriptor*/, |
| 1306 | const WorkloadInfo& /*info*/) const |
Jim Flynn | 4ed6c83 | 2019-05-20 11:02:46 +0100 | [diff] [blame] | 1307 | { |
| 1308 | return std::unique_ptr<IWorkload>(); |
| 1309 | } |
| 1310 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1311 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConstant(const ConstantQueueDescriptor& /*descriptor*/, |
| 1312 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1313 | { |
| 1314 | return std::unique_ptr<IWorkload>(); |
| 1315 | } |
| 1316 | |
Narumol Prangnawarat | 7ddbbae | 2020-03-13 10:26:05 +0000 | [diff] [blame] | 1317 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertBf16ToFp32(const ConvertBf16ToFp32QueueDescriptor& /*desc*/, |
| 1318 | const WorkloadInfo& /*info*/) const |
| 1319 | { |
| 1320 | return std::unique_ptr<IWorkload>(); |
| 1321 | } |
| 1322 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1323 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp16ToFp32(const ConvertFp16ToFp32QueueDescriptor& /*desc*/, |
| 1324 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1325 | { |
| 1326 | return std::unique_ptr<IWorkload>(); |
| 1327 | } |
| 1328 | |
Narumol Prangnawarat | ea54a01 | 2020-03-16 16:36:10 +0000 | [diff] [blame] | 1329 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp32ToBf16(const ConvertFp32ToBf16QueueDescriptor& /*desc*/, |
| 1330 | const WorkloadInfo& /*info*/) const |
| 1331 | { |
| 1332 | return std::unique_ptr<IWorkload>(); |
| 1333 | } |
| 1334 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1335 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvertFp32ToFp16(const ConvertFp32ToFp16QueueDescriptor& /*desc*/, |
| 1336 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1337 | { |
| 1338 | return std::unique_ptr<IWorkload>(); |
| 1339 | } |
| 1340 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1341 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateConvolution2d(const Convolution2dQueueDescriptor& /*descriptor*/, |
| 1342 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1343 | { |
| 1344 | return std::unique_ptr<IWorkload>(); |
| 1345 | } |
| 1346 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1347 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDebug(const DebugQueueDescriptor& /*descriptor*/, |
| 1348 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1349 | { |
| 1350 | return std::unique_ptr<IWorkload>(); |
| 1351 | } |
| 1352 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1353 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDepthToSpace(const DepthToSpaceQueueDescriptor& /*descriptor*/, |
| 1354 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 1355 | { |
| 1356 | return std::unique_ptr<IWorkload>(); |
| 1357 | } |
| 1358 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1359 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDepthwiseConvolution2d( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1360 | const DepthwiseConvolution2dQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1361 | { |
| 1362 | return std::unique_ptr<IWorkload>(); |
| 1363 | } |
| 1364 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 1365 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDequantize( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1366 | const DequantizeQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 1367 | { |
| 1368 | return std::unique_ptr<IWorkload>(); |
| 1369 | } |
| 1370 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1371 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDetectionPostProcess( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1372 | const DetectionPostProcessQueueDescriptor& /*descriptor*/, const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1373 | { |
| 1374 | return std::unique_ptr<IWorkload>(); |
| 1375 | } |
| 1376 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1377 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateDivision(const DivisionQueueDescriptor& /*descriptor*/, |
| 1378 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1379 | { |
| 1380 | return std::unique_ptr<IWorkload>(); |
| 1381 | } |
| 1382 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 1383 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateElementwiseUnary(const ElementwiseUnaryQueueDescriptor& /*desc*/, |
| 1384 | const WorkloadInfo& /*info*/) const |
| 1385 | { |
| 1386 | return std::unique_ptr<IWorkload>(); |
| 1387 | } |
| 1388 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1389 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateEqual(const EqualQueueDescriptor& /*descriptor*/, |
| 1390 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1391 | { |
| 1392 | return std::unique_ptr<IWorkload>(); |
| 1393 | } |
| 1394 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1395 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFakeQuantization(const FakeQuantizationQueueDescriptor& /*desc*/, |
| 1396 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1397 | { |
| 1398 | return std::unique_ptr<IWorkload>(); |
| 1399 | } |
| 1400 | |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 1401 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFill(const FillQueueDescriptor& /*descriptor*/, |
| 1402 | const WorkloadInfo& /*info*/) const |
| 1403 | { |
| 1404 | return std::unique_ptr<IWorkload>(); |
| 1405 | } |
| 1406 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1407 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFloor(const FloorQueueDescriptor& /*descriptor*/, |
| 1408 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1409 | { |
| 1410 | return std::unique_ptr<IWorkload>(); |
| 1411 | } |
| 1412 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1413 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateFullyConnected(const FullyConnectedQueueDescriptor& /*descriptor*/, |
| 1414 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1415 | { |
| 1416 | return std::unique_ptr<IWorkload>(); |
| 1417 | } |
| 1418 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1419 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateGather(const GatherQueueDescriptor& /*descriptor*/, |
| 1420 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1421 | { |
| 1422 | return std::unique_ptr<IWorkload>(); |
| 1423 | } |
| 1424 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1425 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateGreater(const GreaterQueueDescriptor& /*descriptor*/, |
| 1426 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1427 | { |
| 1428 | return std::unique_ptr<IWorkload>(); |
| 1429 | } |
| 1430 | |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 1431 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateInstanceNormalization( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1432 | const InstanceNormalizationQueueDescriptor& /*descriptor*/, |
| 1433 | const WorkloadInfo& /*info*/) const |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 1434 | { |
| 1435 | return std::unique_ptr<IWorkload>(); |
| 1436 | } |
| 1437 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1438 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateL2Normalization(const L2NormalizationQueueDescriptor& /*desc*/, |
| 1439 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1440 | { |
| 1441 | return std::unique_ptr<IWorkload>(); |
| 1442 | } |
| 1443 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1444 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLogSoftmax(const LogSoftmaxQueueDescriptor& /*descriptor*/, |
| 1445 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 1446 | { |
| 1447 | return std::unique_ptr<IWorkload>(); |
| 1448 | } |
| 1449 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1450 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateLstm(const LstmQueueDescriptor& /*descriptor*/, |
| 1451 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1452 | { |
| 1453 | return std::unique_ptr<IWorkload>(); |
| 1454 | } |
| 1455 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1456 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMaximum(const MaximumQueueDescriptor& /*descriptor*/, |
| 1457 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1458 | { |
| 1459 | return std::unique_ptr<IWorkload>(); |
| 1460 | } |
| 1461 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1462 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMean(const MeanQueueDescriptor& /*descriptor*/, |
| 1463 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1464 | { |
| 1465 | return std::unique_ptr<IWorkload>(); |
| 1466 | } |
| 1467 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1468 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMemCopy(const MemCopyQueueDescriptor& /*descriptor*/, |
| 1469 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1470 | { |
| 1471 | return std::unique_ptr<IWorkload>(); |
| 1472 | } |
| 1473 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1474 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMemImport(const MemImportQueueDescriptor& /*descriptor*/, |
| 1475 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 1476 | { |
| 1477 | return std::unique_ptr<IWorkload>(); |
| 1478 | } |
| 1479 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1480 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMerge(const MergeQueueDescriptor& /*descriptor*/, |
| 1481 | const WorkloadInfo& /*info*/) const |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 1482 | { |
| 1483 | return std::unique_ptr<IWorkload>(); |
| 1484 | } |
| 1485 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1486 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMerger(const MergerQueueDescriptor& /*descriptor*/, |
| 1487 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1488 | { |
| 1489 | return std::unique_ptr<IWorkload>(); |
| 1490 | } |
| 1491 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1492 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMinimum(const MinimumQueueDescriptor& /*descriptor*/, |
| 1493 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1494 | { |
| 1495 | return std::unique_ptr<IWorkload>(); |
| 1496 | } |
| 1497 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1498 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateMultiplication(const MultiplicationQueueDescriptor& /*descriptor*/, |
| 1499 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1500 | { |
| 1501 | return std::unique_ptr<IWorkload>(); |
| 1502 | } |
| 1503 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1504 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateNormalization(const NormalizationQueueDescriptor& /*descriptor*/, |
| 1505 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1506 | { |
| 1507 | return std::unique_ptr<IWorkload>(); |
| 1508 | } |
| 1509 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1510 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateOutput(const OutputQueueDescriptor& /*descriptor*/, |
| 1511 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1512 | { |
| 1513 | return std::unique_ptr<IWorkload>(); |
| 1514 | } |
| 1515 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1516 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePad(const PadQueueDescriptor& /*descriptor*/, |
| 1517 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1518 | { |
| 1519 | return std::unique_ptr<IWorkload>(); |
| 1520 | } |
| 1521 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1522 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePermute(const PermuteQueueDescriptor& /*descriptor*/, |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1523 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1524 | { |
| 1525 | return std::unique_ptr<IWorkload>(); |
| 1526 | } |
| 1527 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1528 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePooling2d(const Pooling2dQueueDescriptor& /*descriptor*/, |
| 1529 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1530 | { |
| 1531 | return std::unique_ptr<IWorkload>(); |
| 1532 | } |
| 1533 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1534 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePreCompiled(const PreCompiledQueueDescriptor& /*descriptor*/, |
| 1535 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1536 | { |
| 1537 | return std::unique_ptr<IWorkload>(); |
| 1538 | } |
| 1539 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1540 | std::unique_ptr<IWorkload> IWorkloadFactory::CreatePrelu(const PreluQueueDescriptor &/*descriptor*/, |
| 1541 | const WorkloadInfo &/*info*/) const |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 1542 | { |
| 1543 | return std::unique_ptr<IWorkload>(); |
| 1544 | } |
| 1545 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1546 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQuantize(const QuantizeQueueDescriptor& /*descriptor*/, |
| 1547 | const WorkloadInfo& /*Info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1548 | { |
| 1549 | return std::unique_ptr<IWorkload>(); |
| 1550 | } |
| 1551 | |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 1552 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQLstm(const QLstmQueueDescriptor& /*descriptor*/, |
| 1553 | const WorkloadInfo& /*info*/) const |
| 1554 | { |
| 1555 | return std::unique_ptr<IWorkload>(); |
| 1556 | } |
| 1557 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1558 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateQuantizedLstm(const QuantizedLstmQueueDescriptor& /*descriptor*/, |
| 1559 | const WorkloadInfo& /*info*/) const |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1560 | { |
| 1561 | return std::unique_ptr<IWorkload>(); |
| 1562 | } |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 1563 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateRank(const RankQueueDescriptor& /*descriptor*/, |
| 1564 | const WorkloadInfo& /*info*/) const |
| 1565 | { |
| 1566 | return std::unique_ptr<IWorkload>(); |
| 1567 | } |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 1568 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1569 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateReshape(const ReshapeQueueDescriptor& /*descriptor*/, |
| 1570 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1571 | { |
| 1572 | return std::unique_ptr<IWorkload>(); |
| 1573 | } |
| 1574 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1575 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateResizeBilinear(const ResizeBilinearQueueDescriptor& /*descriptor*/, |
| 1576 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1577 | { |
| 1578 | return std::unique_ptr<IWorkload>(); |
| 1579 | } |
| 1580 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1581 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateResize(const ResizeQueueDescriptor& /*descriptor*/, |
| 1582 | const WorkloadInfo& /*info*/) const |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 1583 | { |
| 1584 | return std::unique_ptr<IWorkload>(); |
| 1585 | } |
| 1586 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1587 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateRsqrt(const RsqrtQueueDescriptor& /*descriptor*/, |
| 1588 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1589 | { |
| 1590 | return std::unique_ptr<IWorkload>(); |
| 1591 | } |
| 1592 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1593 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSlice(const SliceQueueDescriptor& /*descriptor*/, |
| 1594 | const WorkloadInfo& /*info*/) const |
| 1595 | { |
| 1596 | return std::unique_ptr<IWorkload>(); |
| 1597 | } |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1598 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1599 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSoftmax(const SoftmaxQueueDescriptor& /*descriptor*/, |
| 1600 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1601 | { |
| 1602 | return std::unique_ptr<IWorkload>(); |
| 1603 | } |
| 1604 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1605 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSplitter(const SplitterQueueDescriptor& /*descriptor*/, |
| 1606 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1607 | { |
| 1608 | return std::unique_ptr<IWorkload>(); |
| 1609 | } |
| 1610 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1611 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSpaceToBatchNd(const SpaceToBatchNdQueueDescriptor& /*descriptor*/, |
| 1612 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1613 | { |
| 1614 | return std::unique_ptr<IWorkload>(); |
| 1615 | } |
| 1616 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1617 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSpaceToDepth(const SpaceToDepthQueueDescriptor& /*descriptor*/, |
| 1618 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1619 | { |
| 1620 | return std::unique_ptr<IWorkload>(); |
| 1621 | } |
| 1622 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1623 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateStack(const StackQueueDescriptor& /*descriptor*/, |
| 1624 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 1625 | { |
| 1626 | return std::unique_ptr<IWorkload>(); |
| 1627 | } |
| 1628 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1629 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateStridedSlice(const StridedSliceQueueDescriptor& /*descriptor*/, |
| 1630 | const WorkloadInfo& /*info*/) const |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 1631 | { |
| 1632 | return std::unique_ptr<IWorkload>(); |
| 1633 | } |
| 1634 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1635 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSubtraction(const SubtractionQueueDescriptor& /*descriptor*/, |
| 1636 | const WorkloadInfo& /*info*/) const |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 1637 | { |
| 1638 | return std::unique_ptr<IWorkload>(); |
| 1639 | } |
| 1640 | |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1641 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateSwitch(const SwitchQueueDescriptor& /*descriptor*/, |
| 1642 | const WorkloadInfo& /*info*/) const |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 1643 | { |
| 1644 | return std::unique_ptr<IWorkload>(); |
| 1645 | } |
| 1646 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 1647 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateTranspose(const TransposeQueueDescriptor& /*descriptor*/, |
| 1648 | const WorkloadInfo& /*info*/) const |
| 1649 | { |
| 1650 | return std::unique_ptr<IWorkload>(); |
| 1651 | } |
| 1652 | |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1653 | std::unique_ptr<IWorkload> IWorkloadFactory::CreateTransposeConvolution2d( |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 1654 | const TransposeConvolution2dQueueDescriptor& /*descriptor*/, |
| 1655 | const WorkloadInfo& /*info*/) const |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1656 | { |
| 1657 | return std::unique_ptr<IWorkload>(); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 1658 | } |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 1659 | |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 1660 | } // namepsace armnn |