Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [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. |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 6 | #include <armnn/Deprecated.hpp> |
| 7 | #include <armnn/Descriptors.hpp> |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 8 | #include <armnn/Exceptions.hpp> |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 9 | #include <armnn/Types.hpp> |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 10 | |
Matteo Martincigh | e5b8eb9 | 2019-11-28 15:45:42 +0000 | [diff] [blame] | 11 | #include <backendsCommon/LayerSupportBase.hpp> |
| 12 | |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 13 | #include <armnn/utility/IgnoreUnused.hpp> |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 14 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 15 | namespace |
| 16 | { |
| 17 | |
| 18 | bool DefaultLayerSupport(const char* func, |
| 19 | const char* file, |
| 20 | unsigned int line, |
| 21 | armnn::Optional<std::string&> reasonIfUnsupported) |
| 22 | { |
| 23 | // NOTE: We only need to return the reason if the optional parameter is not empty |
| 24 | if (reasonIfUnsupported) |
| 25 | { |
| 26 | std::stringstream message; |
| 27 | message << func << " is not implemented [" << file << ":" << line << "]"; |
| 28 | |
| 29 | reasonIfUnsupported.value() = message.str(); |
| 30 | } |
| 31 | |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | } // anonymous namespace |
| 36 | |
| 37 | namespace armnn |
| 38 | { |
| 39 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 40 | bool LayerSupportBase::IsAbsSupported(const TensorInfo&, // input |
| 41 | const TensorInfo&, // output |
Kevin May | 868eb14 | 2019-09-04 17:29:31 +0100 | [diff] [blame] | 42 | Optional<std::string &> reasonIfUnsupported) const |
| 43 | { |
| 44 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 45 | } |
| 46 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 47 | bool LayerSupportBase::IsActivationSupported(const TensorInfo&, // input |
| 48 | const TensorInfo&, //output |
| 49 | const ActivationDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 50 | Optional<std::string&> reasonIfUnsupported) const |
| 51 | { |
| 52 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 53 | } |
| 54 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 55 | bool LayerSupportBase::IsAdditionSupported(const TensorInfo&, // input0 |
| 56 | const TensorInfo&, // input1 |
| 57 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 58 | Optional<std::string&> reasonIfUnsupported) const |
| 59 | { |
| 60 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 61 | } |
| 62 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 63 | bool LayerSupportBase::IsArgMinMaxSupported(const armnn::TensorInfo&, // input |
| 64 | const armnn::TensorInfo&, // output |
| 65 | const armnn::ArgMinMaxDescriptor&, // descriptor |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 66 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 67 | { |
| 68 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 69 | } |
| 70 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 71 | bool LayerSupportBase::IsBatchNormalizationSupported(const TensorInfo&, //input |
| 72 | const TensorInfo&, // output |
| 73 | const TensorInfo&, //mean |
| 74 | const TensorInfo&, //var |
| 75 | const TensorInfo&, //beta |
| 76 | const TensorInfo&, //gamma |
| 77 | const BatchNormalizationDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 78 | Optional<std::string&> reasonIfUnsupported) const |
| 79 | { |
| 80 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 81 | } |
| 82 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 83 | bool LayerSupportBase::IsBatchToSpaceNdSupported(const TensorInfo&, // input |
| 84 | const TensorInfo&, // output |
| 85 | const BatchToSpaceNdDescriptor&, //descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 86 | Optional<std::string&> reasonIfUnsupported) const |
| 87 | { |
| 88 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 89 | } |
| 90 | |
mathad01 | b392e98 | 2021-04-07 12:07:30 +0100 | [diff] [blame] | 91 | bool LayerSupportBase::IsCastSupported(const TensorInfo&, //input |
| 92 | const TensorInfo&, //output |
| 93 | Optional<std::string &> reasonIfUnsupported) const |
| 94 | { |
| 95 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 96 | } |
| 97 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 98 | bool LayerSupportBase::IsComparisonSupported(const TensorInfo&, // input0 |
| 99 | const TensorInfo&, // input1 |
| 100 | const TensorInfo&, // output |
| 101 | const ComparisonDescriptor&, // descriptor |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 102 | Optional<std::string&> reasonIfUnsupported) const |
| 103 | { |
| 104 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 105 | } |
| 106 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 107 | bool LayerSupportBase::IsConcatSupported(const std::vector<const TensorInfo*>, // inputs |
| 108 | const TensorInfo&, // output |
| 109 | const OriginsDescriptor&, // descriptor |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 110 | Optional<std::string&> reasonIfUnsupported) const |
| 111 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 112 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 113 | } |
| 114 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 115 | bool LayerSupportBase::IsConstantSupported(const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 116 | Optional<std::string&> reasonIfUnsupported) const |
| 117 | { |
| 118 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 119 | } |
| 120 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 121 | bool LayerSupportBase::IsConvertBf16ToFp32Supported(const TensorInfo&, // input |
| 122 | const TensorInfo&, // output |
Narumol Prangnawarat | 7ddbbae | 2020-03-13 10:26:05 +0000 | [diff] [blame] | 123 | Optional<std::string&> reasonIfUnsupported) const |
| 124 | { |
| 125 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 126 | } |
| 127 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 128 | bool LayerSupportBase::IsConvertFp16ToFp32Supported(const TensorInfo&, // input |
| 129 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 130 | Optional<std::string&> reasonIfUnsupported) const |
| 131 | { |
| 132 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 133 | } |
| 134 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 135 | bool LayerSupportBase::IsConvertFp32ToBf16Supported(const TensorInfo&, // input |
| 136 | const TensorInfo&, // output |
Narumol Prangnawarat | ea54a01 | 2020-03-16 16:36:10 +0000 | [diff] [blame] | 137 | Optional<std::string&> reasonIfUnsupported) const |
| 138 | { |
| 139 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 140 | } |
| 141 | |
| 142 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 143 | bool LayerSupportBase::IsConvertFp32ToFp16Supported(const TensorInfo&, // input |
| 144 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 145 | Optional<std::string&> reasonIfUnsupported) const |
| 146 | { |
| 147 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 148 | } |
| 149 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 150 | bool LayerSupportBase::IsConvolution2dSupported(const TensorInfo&, // input |
| 151 | const TensorInfo&, // output |
| 152 | const Convolution2dDescriptor&, // descriptor |
| 153 | const TensorInfo&, // weights |
| 154 | const Optional<TensorInfo>&, // biases |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 155 | Optional<std::string&> reasonIfUnsupported) const |
| 156 | { |
| 157 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 158 | } |
| 159 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 160 | bool LayerSupportBase::IsDebugSupported(const TensorInfo&, // input |
| 161 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 162 | Optional<std::string&> reasonIfUnsupported) const |
| 163 | { |
| 164 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 165 | } |
| 166 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 167 | bool LayerSupportBase::IsDepthToSpaceSupported(const TensorInfo&, // input |
| 168 | const TensorInfo&, // output |
| 169 | const DepthToSpaceDescriptor&, // descriptor |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 170 | Optional<std::string&> reasonIfUnsupported) const |
| 171 | { |
| 172 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 173 | } |
| 174 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 175 | bool LayerSupportBase::IsDepthwiseConvolutionSupported(const TensorInfo&, //input |
| 176 | const TensorInfo&, //output |
| 177 | const DepthwiseConvolution2dDescriptor&, // descriptor |
| 178 | const TensorInfo&, // weights |
| 179 | const Optional<TensorInfo>&, // biases |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 180 | Optional<std::string&> reasonIfUnsupported) const |
| 181 | { |
| 182 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 183 | } |
| 184 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 185 | bool LayerSupportBase::IsDequantizeSupported(const TensorInfo&, // input |
| 186 | const TensorInfo&, // output |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 187 | Optional<std::string&> reasonIfUnsupported) const |
| 188 | { |
| 189 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 190 | } |
| 191 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 192 | bool LayerSupportBase::IsDetectionPostProcessSupported(const TensorInfo&, // boxEncodings |
| 193 | const TensorInfo&, // scores |
| 194 | const TensorInfo&, // anchors |
| 195 | const TensorInfo&, // detectionBoxes |
| 196 | const TensorInfo&, // detectionClasses |
| 197 | const TensorInfo&, // detectionScores |
| 198 | const TensorInfo&, // numDetections |
| 199 | const DetectionPostProcessDescriptor&, //descriptor |
Derek Lamberti | 6a5e5e8 | 2019-12-05 14:41:20 +0000 | [diff] [blame] | 200 | Optional<std::string&> reasonIfUnsupported) const |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 201 | { |
| 202 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 203 | } |
| 204 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 205 | bool LayerSupportBase::IsDilatedDepthwiseConvolutionSupported(const TensorInfo&, // input |
| 206 | const TensorInfo&, // output |
| 207 | const DepthwiseConvolution2dDescriptor&, // descriptor |
| 208 | const TensorInfo&,// weights |
| 209 | const Optional<TensorInfo>&, // biases |
Matteo Martincigh | eac246d | 2019-05-14 09:11:03 +0100 | [diff] [blame] | 210 | Optional<std::string&> reasonIfUnsupported) const |
| 211 | { |
| 212 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 213 | } |
| 214 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 215 | bool LayerSupportBase::IsDivisionSupported(const TensorInfo&, // input0 |
| 216 | const TensorInfo&, // input1 |
| 217 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 218 | Optional<std::string&> reasonIfUnsupported) const |
| 219 | { |
| 220 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 221 | } |
| 222 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 223 | bool LayerSupportBase::IsElementwiseUnarySupported(const TensorInfo& input, |
| 224 | const TensorInfo& output, |
| 225 | const ElementwiseUnaryDescriptor& descriptor, |
| 226 | Optional<std::string&> reasonIfUnsupported) const |
| 227 | { |
| 228 | if (descriptor.m_Operation == UnaryOperation::Abs) |
| 229 | { |
| 230 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
| 231 | return IsAbsSupported(input, output, reasonIfUnsupported); |
| 232 | ARMNN_NO_DEPRECATE_WARN_END |
| 233 | } |
| 234 | else if (descriptor.m_Operation == UnaryOperation::Rsqrt) |
| 235 | { |
| 236 | ARMNN_NO_DEPRECATE_WARN_BEGIN |
| 237 | return IsRsqrtSupported(input, output, reasonIfUnsupported); |
| 238 | ARMNN_NO_DEPRECATE_WARN_END |
| 239 | } |
| 240 | return false; |
| 241 | } |
| 242 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 243 | bool LayerSupportBase::IsEqualSupported(const armnn::TensorInfo&, // input0 |
| 244 | const armnn::TensorInfo&, // input1 |
| 245 | const armnn::TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 246 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 247 | { |
| 248 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 249 | } |
| 250 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 251 | bool LayerSupportBase::IsFakeQuantizationSupported(const TensorInfo&, // input |
| 252 | const FakeQuantizationDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 253 | Optional<std::string&> reasonIfUnsupported) const |
| 254 | { |
| 255 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 256 | } |
| 257 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 258 | bool LayerSupportBase::IsFillSupported(const TensorInfo&, // input |
| 259 | const TensorInfo&, // output |
| 260 | const FillDescriptor&, // descriptor |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 261 | Optional<std::string&> reasonIfUnsupported) const |
| 262 | { |
| 263 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 264 | } |
| 265 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 266 | bool LayerSupportBase::IsFloorSupported(const TensorInfo&, // input |
| 267 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 268 | Optional<std::string&> reasonIfUnsupported) const |
| 269 | { |
| 270 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 271 | } |
| 272 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 273 | bool LayerSupportBase::IsFullyConnectedSupported(const TensorInfo&, // input |
| 274 | const TensorInfo&, // output |
| 275 | const TensorInfo&, // weights |
| 276 | const TensorInfo&, // biases |
| 277 | const FullyConnectedDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 278 | Optional<std::string&> reasonIfUnsupported) const |
| 279 | { |
| 280 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 281 | } |
| 282 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 283 | bool LayerSupportBase::IsGatherSupported(const armnn::TensorInfo&, // input0 |
| 284 | const armnn::TensorInfo&, // input1 |
| 285 | const armnn::TensorInfo&, // output |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 286 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 287 | { |
| 288 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 289 | } |
| 290 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 291 | bool LayerSupportBase::IsGatherSupported(const armnn::TensorInfo&, // input0 |
| 292 | const armnn::TensorInfo&, // input1 |
| 293 | const armnn::TensorInfo&, // output |
| 294 | const GatherDescriptor&, // descriptor |
| 295 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 296 | { |
| 297 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 298 | } |
| 299 | |
| 300 | bool LayerSupportBase::IsGreaterSupported(const TensorInfo&, // input0 |
| 301 | const TensorInfo&, // input1 |
| 302 | const TensorInfo&, // output |
Matteo Martincigh | 3d6898c | 2019-01-15 16:11:44 +0000 | [diff] [blame] | 303 | Optional<std::string&> reasonIfUnsupported) const |
| 304 | { |
| 305 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 306 | } |
| 307 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 308 | bool LayerSupportBase::IsInputSupported(const TensorInfo&, // input |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 309 | Optional<std::string&> reasonIfUnsupported) const |
| 310 | { |
| 311 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 312 | } |
| 313 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 314 | bool LayerSupportBase::IsInstanceNormalizationSupported(const TensorInfo&, // input |
| 315 | const TensorInfo&, // output |
| 316 | const InstanceNormalizationDescriptor&, // descriptor |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 317 | Optional<std::string&> reasonIfUnsupported) const |
| 318 | { |
| 319 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 320 | } |
| 321 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 322 | bool LayerSupportBase::IsL2NormalizationSupported(const TensorInfo&, // input |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 323 | const TensorInfo&, // output |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 324 | const L2NormalizationDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 325 | Optional<std::string&> reasonIfUnsupported) const |
| 326 | { |
| 327 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 328 | } |
| 329 | |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 330 | bool LayerSupportBase::IsLogicalBinarySupported(const TensorInfo&, // input0 |
| 331 | const TensorInfo&, // input1 |
| 332 | const TensorInfo&, // output |
| 333 | const LogicalBinaryDescriptor&, // descriptor |
| 334 | Optional<std::string&> reasonIfUnsupported) const |
| 335 | { |
| 336 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 337 | } |
| 338 | |
| 339 | bool LayerSupportBase::IsLogicalUnarySupported(const TensorInfo&, // input |
| 340 | const TensorInfo&, // output |
| 341 | const ElementwiseUnaryDescriptor&, // descriptor |
| 342 | Optional<std::string&> reasonIfUnsupported) const |
| 343 | { |
| 344 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 345 | } |
| 346 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 347 | bool LayerSupportBase::IsLogSoftmaxSupported(const TensorInfo&, // input |
| 348 | const TensorInfo&, // output |
| 349 | const LogSoftmaxDescriptor&, // descriptor |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 350 | Optional<std::string&> reasonIfUnsupported) const |
| 351 | { |
| 352 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 353 | } |
| 354 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 355 | bool LayerSupportBase::IsLstmSupported(const TensorInfo&, // input |
| 356 | const TensorInfo&, // outputStateIn |
| 357 | const TensorInfo&, // cellStateIn |
| 358 | const TensorInfo&, // scratchBuffer |
| 359 | const TensorInfo&, // outputStateOut |
| 360 | const TensorInfo&, // cellStateOut |
| 361 | const TensorInfo&, // output |
| 362 | const LstmDescriptor&, // descriptor |
| 363 | const LstmInputParamsInfo&, // paramsInfo |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 364 | Optional<std::string&> reasonIfUnsupported) const |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 365 | { |
| 366 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 367 | } |
| 368 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 369 | bool LayerSupportBase::IsMaximumSupported(const TensorInfo&, // input0 |
| 370 | const TensorInfo&, // input1 |
| 371 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 372 | Optional<std::string&> reasonIfUnsupported) const |
| 373 | { |
| 374 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 375 | } |
| 376 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 377 | bool LayerSupportBase::IsMeanSupported(const TensorInfo&, // input |
| 378 | const TensorInfo&, // output |
| 379 | const MeanDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 380 | Optional<std::string&> reasonIfUnsupported) const |
| 381 | { |
| 382 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 383 | } |
| 384 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 385 | bool LayerSupportBase::IsMemCopySupported(const armnn::TensorInfo&, // input |
| 386 | const armnn::TensorInfo&, // output |
| 387 | armnn::Optional<std::string &> ) const // reasonIfUnsupported |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 388 | { |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 389 | return true; |
| 390 | } |
| 391 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 392 | bool LayerSupportBase::IsMemImportSupported(const armnn::TensorInfo&, // input |
| 393 | const armnn::TensorInfo&, // output |
| 394 | armnn::Optional<std::string &> ) const // reasonIfUnsupported |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 395 | { |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 396 | return true; |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 397 | } |
| 398 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 399 | bool LayerSupportBase::IsMergeSupported(const TensorInfo&, // input0 |
| 400 | const TensorInfo&, // input1 |
| 401 | const TensorInfo&, // output |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 402 | Optional<std::string&> reasonIfUnsupported) const |
| 403 | { |
| 404 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 405 | } |
| 406 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 407 | bool LayerSupportBase::IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
| 408 | const TensorInfo& output, |
| 409 | const OriginsDescriptor& descriptor, |
| 410 | Optional<std::string&> reasonIfUnsupported) const |
| 411 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 412 | return IsConcatSupported(inputs, output, descriptor, reasonIfUnsupported); |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 413 | } |
| 414 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 415 | bool LayerSupportBase::IsMinimumSupported(const TensorInfo&, // input0 |
| 416 | const TensorInfo&, // input1 |
| 417 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 418 | Optional<std::string&> reasonIfUnsupported) const |
| 419 | { |
| 420 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 421 | } |
| 422 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 423 | bool LayerSupportBase::IsMultiplicationSupported(const TensorInfo&, // input0 |
| 424 | const TensorInfo&, // input1 |
| 425 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 426 | Optional<std::string&> reasonIfUnsupported) const |
| 427 | { |
| 428 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 429 | } |
| 430 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 431 | bool LayerSupportBase::IsNormalizationSupported(const TensorInfo&, // input |
| 432 | const TensorInfo&, // output |
| 433 | const NormalizationDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 434 | Optional<std::string&> reasonIfUnsupported) const |
| 435 | { |
| 436 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 437 | } |
| 438 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 439 | bool LayerSupportBase::IsOutputSupported(const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 440 | Optional<std::string&> reasonIfUnsupported) const |
| 441 | { |
| 442 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 443 | } |
| 444 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 445 | bool LayerSupportBase::IsPadSupported(const TensorInfo&, // input |
| 446 | const TensorInfo&, // output |
| 447 | const PadDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 448 | Optional<std::string&> reasonIfUnsupported) const |
| 449 | { |
| 450 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 451 | } |
| 452 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 453 | bool LayerSupportBase::IsPermuteSupported(const TensorInfo&, // input |
| 454 | const TensorInfo&, // output |
| 455 | const PermuteDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 456 | Optional<std::string&> reasonIfUnsupported) const |
| 457 | { |
| 458 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 459 | } |
| 460 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 461 | bool LayerSupportBase::IsPooling2dSupported(const TensorInfo&, // input |
| 462 | const TensorInfo&, // output |
| 463 | const Pooling2dDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 464 | Optional<std::string&> reasonIfUnsupported) const |
| 465 | { |
| 466 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 467 | } |
| 468 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 469 | bool LayerSupportBase::IsPreCompiledSupported(const TensorInfo&, // input |
| 470 | const PreCompiledDescriptor&, // descriptor |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 471 | Optional<std::string&> reasonIfUnsupported) const |
| 472 | { |
| 473 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 474 | } |
| 475 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 476 | bool LayerSupportBase::IsPreluSupported(const TensorInfo&, // input |
| 477 | const TensorInfo&, // alpha |
| 478 | const TensorInfo&, // output |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 479 | Optional<std::string &> reasonIfUnsupported) const |
| 480 | { |
| 481 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 482 | } |
| 483 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 484 | bool LayerSupportBase::IsQuantizeSupported(const armnn::TensorInfo&, // input |
| 485 | const armnn::TensorInfo&, // output |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 486 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 487 | { |
| 488 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 489 | } |
| 490 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 491 | bool LayerSupportBase::IsQLstmSupported(const TensorInfo&, // input |
| 492 | const TensorInfo&, // previousOutputIn |
| 493 | const TensorInfo&, // previousCellStateIn |
| 494 | const TensorInfo&, // outputStateOut |
| 495 | const TensorInfo&, // cellStateOut |
| 496 | const TensorInfo&, // output |
| 497 | const QLstmDescriptor&, // descriptor |
| 498 | const LstmInputParamsInfo&, // paramsInfo |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 499 | Optional<std::string&> reasonIfUnsupported) const |
| 500 | { |
| 501 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 502 | } |
| 503 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 504 | bool LayerSupportBase::IsQuantizedLstmSupported(const TensorInfo&, // input |
| 505 | const TensorInfo&, // previousCellStateIn |
| 506 | const TensorInfo&, // previousOutputIn |
| 507 | const TensorInfo&, // cellStateOut |
| 508 | const TensorInfo&, // output |
| 509 | const QuantizedLstmInputParamsInfo&, // paramsInfo |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 510 | Optional<std::string&> reasonIfUnsupported) const |
| 511 | { |
| 512 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 513 | } |
| 514 | |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 515 | bool LayerSupportBase::IsRankSupported(const TensorInfo&, // input |
| 516 | const TensorInfo&, // output |
| 517 | Optional<std::string&> reasonIfUnsupported) const |
| 518 | { |
| 519 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 520 | } |
| 521 | |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 522 | bool LayerSupportBase::IsReduceSupported(const TensorInfo& /*input*/, |
| 523 | const TensorInfo& /*output*/, |
| 524 | const ReduceDescriptor& /*descriptor*/, |
| 525 | Optional<std::string&> reasonIfUnsupported) const |
| 526 | { |
| 527 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 528 | } |
| 529 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 530 | bool LayerSupportBase::IsReshapeSupported(const TensorInfo&, // input |
| 531 | const TensorInfo&, // output |
| 532 | const ReshapeDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 533 | Optional<std::string&> reasonIfUnsupported) const |
| 534 | { |
| 535 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 536 | } |
| 537 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 538 | bool LayerSupportBase::IsResizeBilinearSupported(const TensorInfo&, // input |
| 539 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 540 | Optional<std::string&> reasonIfUnsupported) const |
| 541 | { |
| 542 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 543 | } |
| 544 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 545 | bool LayerSupportBase::IsResizeSupported(const TensorInfo&, // input |
| 546 | const TensorInfo&, // output |
| 547 | const ResizeDescriptor&, // descriptor |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 548 | Optional<std::string&> reasonIfUnsupported) const |
| 549 | { |
| 550 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 551 | } |
| 552 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 553 | bool LayerSupportBase::IsRsqrtSupported(const TensorInfo&, // input |
| 554 | const TensorInfo&, // output |
Matteo Martincigh | 3d6898c | 2019-01-15 16:11:44 +0000 | [diff] [blame] | 555 | Optional<std::string &> reasonIfUnsupported) const |
| 556 | { |
| 557 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 558 | } |
| 559 | |
Keith Davis | 3ae3f97 | 2021-05-21 16:33:48 +0100 | [diff] [blame] | 560 | bool LayerSupportBase::IsShapeSupported(const TensorInfo&, // input |
| 561 | const TensorInfo&, // output |
| 562 | Optional<std::string&> reasonIfUnsupported) const |
| 563 | { |
| 564 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 565 | } |
| 566 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 567 | bool LayerSupportBase::IsSliceSupported(const TensorInfo&, // input |
| 568 | const TensorInfo&, // output |
| 569 | const SliceDescriptor&, // descriptor |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 570 | Optional<std::string&> reasonIfUnsupported) const |
| 571 | { |
| 572 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 573 | } |
| 574 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 575 | bool LayerSupportBase::IsSoftmaxSupported(const TensorInfo&, // input |
| 576 | const TensorInfo&, // output |
| 577 | const SoftmaxDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 578 | Optional<std::string&> reasonIfUnsupported) const |
| 579 | { |
| 580 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 581 | } |
Derek Lamberti | 901ea11 | 2019-12-10 22:07:09 +0000 | [diff] [blame] | 582 | /**/ |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 583 | bool LayerSupportBase::IsSpaceToBatchNdSupported(const TensorInfo&, // input |
| 584 | const TensorInfo&, // output |
| 585 | const SpaceToBatchNdDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 586 | Optional<std::string&> reasonIfUnsupported) const |
| 587 | { |
| 588 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 589 | } |
| 590 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 591 | bool LayerSupportBase::IsSpaceToDepthSupported(const TensorInfo&, // input |
| 592 | const TensorInfo&, // output |
| 593 | const SpaceToDepthDescriptor&, // descriptor |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 594 | Optional<std::string&> reasonIfUnsupported) const |
| 595 | { |
| 596 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 597 | } |
| 598 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 599 | bool LayerSupportBase::IsSplitterSupported(const TensorInfo&, // input |
| 600 | const ViewsDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 601 | Optional<std::string&> reasonIfUnsupported) const |
| 602 | { |
| 603 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 604 | } |
| 605 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 606 | bool LayerSupportBase::IsSplitterSupported(const TensorInfo&, // input |
| 607 | const std::vector<std::reference_wrapper<TensorInfo>>&, // outputs |
| 608 | const ViewsDescriptor&, // descriptor |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 609 | Optional<std::string&> reasonIfUnsupported) const |
| 610 | { |
| 611 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 612 | } |
| 613 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 614 | bool LayerSupportBase::IsStackSupported(const std::vector<const TensorInfo*>&, // inputs |
| 615 | const TensorInfo&, // output |
| 616 | const StackDescriptor&, // descriptor |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 617 | Optional<std::string&> reasonIfUnsupported) const |
| 618 | { |
| 619 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 620 | } |
| 621 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 622 | bool LayerSupportBase::IsStandInSupported(const std::vector<const TensorInfo*>&, // inputs |
| 623 | const std::vector<const TensorInfo*>&, // outputs |
| 624 | const StandInDescriptor&, // descriptor |
Derek Lamberti | 013c390 | 2019-10-21 10:46:16 +0100 | [diff] [blame] | 625 | Optional<std::string&> reasonIfUnsupported) const |
| 626 | { |
| 627 | if (reasonIfUnsupported) |
| 628 | { |
| 629 | std::stringstream message; |
| 630 | message << "StandIn layer is not executable via backends"; |
| 631 | |
| 632 | reasonIfUnsupported.value() = message.str(); |
| 633 | } |
| 634 | |
| 635 | return false; |
| 636 | } |
| 637 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 638 | bool LayerSupportBase::IsStridedSliceSupported(const TensorInfo&, // input |
| 639 | const TensorInfo&, // output |
| 640 | const StridedSliceDescriptor&, // descriptor |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 641 | Optional<std::string&> reasonIfUnsupported) const |
| 642 | { |
| 643 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 644 | } |
| 645 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 646 | bool LayerSupportBase::IsSubtractionSupported(const TensorInfo&, // input0 |
| 647 | const TensorInfo&, // input1 |
| 648 | const TensorInfo&, // output |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 649 | Optional<std::string&> reasonIfUnsupported) const |
| 650 | { |
| 651 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 652 | } |
| 653 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 654 | bool LayerSupportBase::IsSwitchSupported(const TensorInfo&, // input0 |
| 655 | const TensorInfo&, // input1 |
| 656 | const TensorInfo&, // output0 |
| 657 | const TensorInfo&, // output1 |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 658 | Optional<std::string&> reasonIfUnsupported) const |
| 659 | { |
| 660 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 661 | } |
| 662 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 663 | bool LayerSupportBase::IsTransposeConvolution2dSupported(const TensorInfo&, // input |
| 664 | const TensorInfo&, // output |
| 665 | const TransposeConvolution2dDescriptor&, // descriptor |
| 666 | const TensorInfo&, // weights |
| 667 | const Optional<TensorInfo>&, // biases |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 668 | Optional<std::string&> reasonIfUnsupported) const |
| 669 | { |
| 670 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 671 | } |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 672 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 673 | bool LayerSupportBase::IsTransposeSupported(const TensorInfo&, // input |
| 674 | const TensorInfo&, // output |
| 675 | const TransposeDescriptor&, // descriptor |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 676 | Optional<std::string&> reasonIfUnsupported) const |
| 677 | { |
| 678 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 679 | } |
| 680 | |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 681 | bool LayerSupportBase::IsUnidirectionalSequenceLstmSupported(const TensorInfo&, // input |
| 682 | const TensorInfo&, // outputStateIn |
| 683 | const TensorInfo&, // cellStateIn |
| 684 | const TensorInfo&, // output |
| 685 | const Optional<TensorInfo>&, // hiddenStateOut |
| 686 | const Optional<TensorInfo>&, // cellStateOut |
| 687 | const LstmDescriptor&, // descriptor |
| 688 | const LstmInputParamsInfo&, // paramsInfo |
| 689 | Optional<std::string&> reasonIfUnsupported) const |
| 690 | { |
| 691 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 692 | } |
| 693 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 694 | } // namespace armnn |