Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "LayerSupportBase.hpp" |
| 7 | |
| 8 | #include <armnn/Exceptions.hpp> |
| 9 | |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 10 | #include <boost/core/ignore_unused.hpp> |
| 11 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 12 | namespace |
| 13 | { |
| 14 | |
| 15 | bool DefaultLayerSupport(const char* func, |
| 16 | const char* file, |
| 17 | unsigned int line, |
| 18 | armnn::Optional<std::string&> reasonIfUnsupported) |
| 19 | { |
| 20 | // NOTE: We only need to return the reason if the optional parameter is not empty |
| 21 | if (reasonIfUnsupported) |
| 22 | { |
| 23 | std::stringstream message; |
| 24 | message << func << " is not implemented [" << file << ":" << line << "]"; |
| 25 | |
| 26 | reasonIfUnsupported.value() = message.str(); |
| 27 | } |
| 28 | |
| 29 | return false; |
| 30 | } |
| 31 | |
| 32 | } // anonymous namespace |
| 33 | |
| 34 | namespace armnn |
| 35 | { |
| 36 | |
Kevin May | 868eb14 | 2019-09-04 17:29:31 +0100 | [diff] [blame] | 37 | bool LayerSupportBase::IsAbsSupported(const TensorInfo &input, |
| 38 | const TensorInfo &output, |
| 39 | Optional<std::string &> reasonIfUnsupported) const |
| 40 | { |
| 41 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 42 | } |
| 43 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 44 | bool LayerSupportBase::IsActivationSupported(const TensorInfo& input, |
| 45 | const TensorInfo& output, |
| 46 | const ActivationDescriptor& descriptor, |
| 47 | Optional<std::string&> reasonIfUnsupported) const |
| 48 | { |
| 49 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 50 | } |
| 51 | |
| 52 | bool LayerSupportBase::IsAdditionSupported(const TensorInfo& input0, |
| 53 | const TensorInfo& input1, |
| 54 | const TensorInfo& output, |
| 55 | Optional<std::string&> reasonIfUnsupported) const |
| 56 | { |
| 57 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 58 | } |
| 59 | |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 60 | bool LayerSupportBase::IsArgMinMaxSupported(const armnn::TensorInfo &input, const armnn::TensorInfo &output, |
| 61 | const armnn::ArgMinMaxDescriptor& descriptor, |
| 62 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 63 | { |
| 64 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 65 | } |
| 66 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 67 | bool LayerSupportBase::IsBatchNormalizationSupported(const TensorInfo& input, |
| 68 | const TensorInfo& output, |
| 69 | const TensorInfo& mean, |
| 70 | const TensorInfo& var, |
| 71 | const TensorInfo& beta, |
| 72 | const TensorInfo& gamma, |
| 73 | const BatchNormalizationDescriptor& descriptor, |
| 74 | Optional<std::string&> reasonIfUnsupported) const |
| 75 | { |
| 76 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 77 | } |
| 78 | |
| 79 | bool LayerSupportBase::IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 80 | const TensorInfo& output, |
| 81 | const BatchToSpaceNdDescriptor& descriptor, |
| 82 | Optional<std::string&> reasonIfUnsupported) const |
| 83 | { |
| 84 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 85 | } |
| 86 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 87 | bool LayerSupportBase::IsComparisonSupported(const TensorInfo& input0, |
| 88 | const TensorInfo& input1, |
| 89 | const TensorInfo& output, |
| 90 | const ComparisonDescriptor& descriptor, |
| 91 | Optional<std::string&> reasonIfUnsupported) const |
| 92 | { |
| 93 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 94 | } |
| 95 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 96 | bool LayerSupportBase::IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 97 | const TensorInfo& output, |
| 98 | const OriginsDescriptor& descriptor, |
| 99 | Optional<std::string&> reasonIfUnsupported) const |
| 100 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 101 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 102 | } |
| 103 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 104 | bool LayerSupportBase::IsConstantSupported(const TensorInfo& output, |
| 105 | Optional<std::string&> reasonIfUnsupported) const |
| 106 | { |
| 107 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 108 | } |
| 109 | |
| 110 | bool LayerSupportBase::IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 111 | const TensorInfo& output, |
| 112 | Optional<std::string&> reasonIfUnsupported) const |
| 113 | { |
| 114 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 115 | } |
| 116 | |
| 117 | bool LayerSupportBase::IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 118 | const TensorInfo& output, |
| 119 | Optional<std::string&> reasonIfUnsupported) const |
| 120 | { |
| 121 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 122 | } |
| 123 | |
| 124 | bool LayerSupportBase::IsConvolution2dSupported(const TensorInfo& input, |
| 125 | const TensorInfo& output, |
| 126 | const Convolution2dDescriptor& descriptor, |
| 127 | const TensorInfo& weights, |
| 128 | const Optional<TensorInfo>& biases, |
| 129 | Optional<std::string&> reasonIfUnsupported) const |
| 130 | { |
| 131 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 132 | } |
| 133 | |
| 134 | bool LayerSupportBase::IsDebugSupported(const TensorInfo& input, |
| 135 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 136 | Optional<std::string&> reasonIfUnsupported) const |
| 137 | { |
| 138 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 139 | } |
| 140 | |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 141 | bool LayerSupportBase::IsDepthToSpaceSupported(const TensorInfo& input, |
| 142 | const TensorInfo& output, |
| 143 | const DepthToSpaceDescriptor& descriptor, |
| 144 | Optional<std::string&> reasonIfUnsupported) const |
| 145 | { |
| 146 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 147 | } |
| 148 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 149 | bool LayerSupportBase::IsDepthwiseConvolutionSupported(const TensorInfo& input, |
| 150 | const TensorInfo& output, |
| 151 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 152 | const TensorInfo& weights, |
| 153 | const Optional<TensorInfo>& biases, |
| 154 | Optional<std::string&> reasonIfUnsupported) const |
| 155 | { |
| 156 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 157 | } |
| 158 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 159 | bool LayerSupportBase::IsDequantizeSupported(const TensorInfo& input, |
| 160 | const TensorInfo& output, |
| 161 | Optional<std::string&> reasonIfUnsupported) const |
| 162 | { |
| 163 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 164 | } |
| 165 | |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 166 | bool LayerSupportBase::IsDetectionPostProcessSupported(const armnn::TensorInfo& input0, |
| 167 | const armnn::TensorInfo& input1, |
| 168 | const armnn::DetectionPostProcessDescriptor& descriptor, |
| 169 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 170 | { |
| 171 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 172 | } |
| 173 | |
Matteo Martincigh | eac246d | 2019-05-14 09:11:03 +0100 | [diff] [blame] | 174 | bool LayerSupportBase::IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, |
| 175 | const TensorInfo& output, |
| 176 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 177 | const TensorInfo& weights, |
| 178 | const Optional<TensorInfo>& biases, |
| 179 | Optional<std::string&> reasonIfUnsupported) const |
| 180 | { |
| 181 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 182 | } |
| 183 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 184 | bool LayerSupportBase::IsDivisionSupported(const TensorInfo& input0, |
| 185 | const TensorInfo& input1, |
| 186 | const TensorInfo& output, |
| 187 | Optional<std::string&> reasonIfUnsupported) const |
| 188 | { |
| 189 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 190 | } |
| 191 | |
| 192 | bool LayerSupportBase::IsEqualSupported(const armnn::TensorInfo& input0, |
| 193 | const armnn::TensorInfo& input1, |
| 194 | const armnn::TensorInfo& output, |
| 195 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 196 | { |
| 197 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 198 | } |
| 199 | |
| 200 | bool LayerSupportBase::IsFakeQuantizationSupported(const TensorInfo& input, |
| 201 | const FakeQuantizationDescriptor& descriptor, |
| 202 | Optional<std::string&> reasonIfUnsupported) const |
| 203 | { |
| 204 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 205 | } |
| 206 | |
| 207 | bool LayerSupportBase::IsFloorSupported(const TensorInfo& input, |
| 208 | const TensorInfo& output, |
| 209 | Optional<std::string&> reasonIfUnsupported) const |
| 210 | { |
| 211 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 212 | } |
| 213 | |
| 214 | bool LayerSupportBase::IsFullyConnectedSupported(const TensorInfo& input, |
| 215 | const TensorInfo& output, |
| 216 | const TensorInfo& weights, |
| 217 | const TensorInfo& biases, |
| 218 | const FullyConnectedDescriptor& descriptor, |
| 219 | Optional<std::string&> reasonIfUnsupported) const |
| 220 | { |
| 221 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 222 | } |
| 223 | |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 224 | bool LayerSupportBase::IsGatherSupported(const armnn::TensorInfo& input0, |
| 225 | const armnn::TensorInfo& input1, |
| 226 | const armnn::TensorInfo& output, |
| 227 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 228 | { |
| 229 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 230 | } |
| 231 | |
Matteo Martincigh | 3d6898c | 2019-01-15 16:11:44 +0000 | [diff] [blame] | 232 | bool LayerSupportBase::IsGreaterSupported(const TensorInfo& input0, |
| 233 | const TensorInfo& input1, |
| 234 | const TensorInfo& output, |
| 235 | Optional<std::string&> reasonIfUnsupported) const |
| 236 | { |
| 237 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 238 | } |
| 239 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 240 | bool LayerSupportBase::IsInputSupported(const TensorInfo& input, |
| 241 | Optional<std::string&> reasonIfUnsupported) const |
| 242 | { |
| 243 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 244 | } |
| 245 | |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 246 | bool LayerSupportBase::IsInstanceNormalizationSupported(const TensorInfo& input, |
| 247 | const TensorInfo& output, |
| 248 | const InstanceNormalizationDescriptor& descriptor, |
| 249 | Optional<std::string&> reasonIfUnsupported) const |
| 250 | { |
| 251 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 252 | } |
| 253 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 254 | bool LayerSupportBase::IsL2NormalizationSupported(const TensorInfo& input, |
| 255 | const TensorInfo& output, |
| 256 | const L2NormalizationDescriptor& descriptor, |
| 257 | Optional<std::string&> reasonIfUnsupported) const |
| 258 | { |
| 259 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 260 | } |
| 261 | |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 262 | bool LayerSupportBase::IsLogSoftmaxSupported(const TensorInfo& input, |
| 263 | const TensorInfo& output, |
| 264 | const LogSoftmaxDescriptor& descriptor, |
| 265 | Optional<std::string&> reasonIfUnsupported) const |
| 266 | { |
| 267 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 268 | } |
| 269 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 270 | bool LayerSupportBase::IsLstmSupported(const TensorInfo& input, |
| 271 | const TensorInfo& outputStateIn, |
| 272 | const TensorInfo& cellStateIn, |
| 273 | const TensorInfo& scratchBuffer, |
| 274 | const TensorInfo& outputStateOut, |
| 275 | const TensorInfo& cellStateOut, |
| 276 | const TensorInfo& output, |
| 277 | const LstmDescriptor& descriptor, |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 278 | const LstmInputParamsInfo& paramsInfo, |
| 279 | Optional<std::string&> reasonIfUnsupported) const |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 280 | { |
| 281 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 282 | } |
| 283 | |
| 284 | bool LayerSupportBase::IsMaximumSupported(const TensorInfo& input0, |
| 285 | const TensorInfo& input1, |
| 286 | const TensorInfo& output, |
| 287 | Optional<std::string&> reasonIfUnsupported) const |
| 288 | { |
| 289 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 290 | } |
| 291 | |
| 292 | bool LayerSupportBase::IsMeanSupported(const TensorInfo& input, |
| 293 | const TensorInfo& output, |
| 294 | const MeanDescriptor& descriptor, |
| 295 | Optional<std::string&> reasonIfUnsupported) const |
| 296 | { |
| 297 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 298 | } |
| 299 | |
| 300 | bool LayerSupportBase::IsMemCopySupported(const armnn::TensorInfo& input, |
| 301 | const armnn::TensorInfo& output, |
| 302 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 303 | { |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 304 | boost::ignore_unused(input); |
| 305 | boost::ignore_unused(output); |
| 306 | return true; |
| 307 | } |
| 308 | |
| 309 | bool LayerSupportBase::IsMemImportSupported(const armnn::TensorInfo& input, |
| 310 | const armnn::TensorInfo& output, |
| 311 | armnn::Optional<std::string &> reasonIfUnsupported) const |
| 312 | { |
| 313 | boost::ignore_unused(input); |
| 314 | boost::ignore_unused(output); |
| 315 | return true; |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 316 | } |
| 317 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 318 | bool LayerSupportBase::IsMergeSupported(const TensorInfo& input0, |
| 319 | const TensorInfo& input1, |
| 320 | const TensorInfo& output, |
| 321 | Optional<std::string&> reasonIfUnsupported) const |
| 322 | { |
| 323 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 324 | } |
| 325 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 326 | bool LayerSupportBase::IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
| 327 | const TensorInfo& output, |
| 328 | const OriginsDescriptor& descriptor, |
| 329 | Optional<std::string&> reasonIfUnsupported) const |
| 330 | { |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 331 | return IsConcatSupported(inputs, output, descriptor, reasonIfUnsupported); |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | bool LayerSupportBase::IsMinimumSupported(const TensorInfo& input0, |
| 335 | const TensorInfo& input1, |
| 336 | const TensorInfo& output, |
| 337 | Optional<std::string&> reasonIfUnsupported) const |
| 338 | { |
| 339 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 340 | } |
| 341 | |
| 342 | bool LayerSupportBase::IsMultiplicationSupported(const TensorInfo& input0, |
| 343 | const TensorInfo& input1, |
| 344 | const TensorInfo& output, |
| 345 | Optional<std::string&> reasonIfUnsupported) const |
| 346 | { |
| 347 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 348 | } |
| 349 | |
| 350 | bool LayerSupportBase::IsNormalizationSupported(const TensorInfo& input, |
| 351 | const TensorInfo& output, |
| 352 | const NormalizationDescriptor& descriptor, |
| 353 | Optional<std::string&> reasonIfUnsupported) const |
| 354 | { |
| 355 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 356 | } |
| 357 | |
| 358 | bool LayerSupportBase::IsOutputSupported(const TensorInfo& output, |
| 359 | Optional<std::string&> reasonIfUnsupported) const |
| 360 | { |
| 361 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 362 | } |
| 363 | |
| 364 | bool LayerSupportBase::IsPadSupported(const TensorInfo& input, |
| 365 | const TensorInfo& output, |
| 366 | const PadDescriptor& descriptor, |
| 367 | Optional<std::string&> reasonIfUnsupported) const |
| 368 | { |
| 369 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 370 | } |
| 371 | |
| 372 | bool LayerSupportBase::IsPermuteSupported(const TensorInfo& input, |
| 373 | const TensorInfo& output, |
| 374 | const PermuteDescriptor& descriptor, |
| 375 | Optional<std::string&> reasonIfUnsupported) const |
| 376 | { |
| 377 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 378 | } |
| 379 | |
| 380 | bool LayerSupportBase::IsPooling2dSupported(const TensorInfo& input, |
| 381 | const TensorInfo& output, |
| 382 | const Pooling2dDescriptor& descriptor, |
| 383 | Optional<std::string&> reasonIfUnsupported) const |
| 384 | { |
| 385 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 386 | } |
| 387 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 388 | bool LayerSupportBase::IsPreCompiledSupported(const TensorInfo& input, |
| 389 | const PreCompiledDescriptor& descriptor, |
| 390 | Optional<std::string&> reasonIfUnsupported) const |
| 391 | { |
| 392 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 393 | } |
| 394 | |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 395 | bool LayerSupportBase::IsPreluSupported(const TensorInfo& input, |
| 396 | const TensorInfo& alpha, |
| 397 | const TensorInfo& output, |
| 398 | Optional<std::string &> reasonIfUnsupported) const |
| 399 | { |
| 400 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 401 | } |
| 402 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 403 | bool LayerSupportBase::IsQuantizeSupported(const armnn::TensorInfo& input, |
| 404 | const armnn::TensorInfo& output, |
| 405 | armnn::Optional<std::string&> reasonIfUnsupported) const |
| 406 | { |
| 407 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 408 | } |
| 409 | |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 410 | bool LayerSupportBase::IsQuantizedLstmSupported(const TensorInfo& input, |
| 411 | const TensorInfo& previousCellStateIn, |
| 412 | const TensorInfo& previousOutputIn, |
| 413 | const TensorInfo& cellStateOut, |
| 414 | const TensorInfo& output, |
| 415 | const QuantizedLstmInputParamsInfo& paramsInfo, |
| 416 | Optional<std::string&> reasonIfUnsupported) const |
| 417 | { |
| 418 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 419 | } |
| 420 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 421 | bool LayerSupportBase::IsReshapeSupported(const TensorInfo& input, |
| 422 | const ReshapeDescriptor& descriptor, |
| 423 | Optional<std::string&> reasonIfUnsupported) const |
| 424 | { |
| 425 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 426 | } |
| 427 | |
| 428 | bool LayerSupportBase::IsResizeBilinearSupported(const TensorInfo& input, |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 429 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 430 | Optional<std::string&> reasonIfUnsupported) const |
| 431 | { |
| 432 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 433 | } |
| 434 | |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 435 | bool LayerSupportBase::IsResizeSupported(const TensorInfo& input, |
| 436 | const TensorInfo& output, |
| 437 | const ResizeDescriptor& descriptor, |
| 438 | Optional<std::string&> reasonIfUnsupported) const |
| 439 | { |
| 440 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 441 | } |
| 442 | |
Matteo Martincigh | 3d6898c | 2019-01-15 16:11:44 +0000 | [diff] [blame] | 443 | bool LayerSupportBase::IsRsqrtSupported(const TensorInfo &input, |
| 444 | const TensorInfo &output, |
| 445 | Optional<std::string &> reasonIfUnsupported) const |
| 446 | { |
| 447 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 448 | } |
| 449 | |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 450 | bool LayerSupportBase::IsSliceSupported(const TensorInfo& input, |
| 451 | const TensorInfo& output, |
| 452 | const SliceDescriptor& descriptor, |
| 453 | Optional<std::string&> reasonIfUnsupported) const |
| 454 | { |
| 455 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 456 | } |
| 457 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 458 | bool LayerSupportBase::IsSoftmaxSupported(const TensorInfo& input, |
| 459 | const TensorInfo& output, |
| 460 | const SoftmaxDescriptor& descriptor, |
| 461 | Optional<std::string&> reasonIfUnsupported) const |
| 462 | { |
| 463 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 464 | } |
| 465 | |
| 466 | bool LayerSupportBase::IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 467 | const TensorInfo& output, |
| 468 | const SpaceToBatchNdDescriptor& descriptor, |
| 469 | Optional<std::string&> reasonIfUnsupported) const |
| 470 | { |
| 471 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 472 | } |
| 473 | |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 474 | bool LayerSupportBase::IsSpaceToDepthSupported(const TensorInfo& input, |
| 475 | const TensorInfo& output, |
| 476 | const SpaceToDepthDescriptor& descriptor, |
| 477 | Optional<std::string&> reasonIfUnsupported) const |
| 478 | { |
| 479 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 480 | } |
| 481 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 482 | bool LayerSupportBase::IsSplitterSupported(const TensorInfo& input, |
| 483 | const ViewsDescriptor& descriptor, |
| 484 | Optional<std::string&> reasonIfUnsupported) const |
| 485 | { |
| 486 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 487 | } |
| 488 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 489 | bool LayerSupportBase::IsSplitterSupported(const TensorInfo& input, |
| 490 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 491 | const ViewsDescriptor& descriptor, |
| 492 | Optional<std::string&> reasonIfUnsupported) const |
| 493 | { |
| 494 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 495 | } |
| 496 | |
Matthew Jackson | 81e601c | 2019-07-11 12:07:09 +0100 | [diff] [blame] | 497 | bool LayerSupportBase::IsStackSupported(const std::vector<const TensorInfo*>& inputs, |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 498 | const TensorInfo& output, |
| 499 | const StackDescriptor& descriptor, |
| 500 | Optional<std::string&> reasonIfUnsupported) const |
| 501 | { |
| 502 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 503 | } |
| 504 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 505 | bool LayerSupportBase::IsStridedSliceSupported(const TensorInfo& input, |
| 506 | const TensorInfo& output, |
| 507 | const StridedSliceDescriptor& descriptor, |
| 508 | Optional<std::string&> reasonIfUnsupported) const |
| 509 | { |
| 510 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 511 | } |
| 512 | |
| 513 | bool LayerSupportBase::IsSubtractionSupported(const TensorInfo& input0, |
| 514 | const TensorInfo& input1, |
| 515 | const TensorInfo& output, |
| 516 | Optional<std::string&> reasonIfUnsupported) const |
| 517 | { |
| 518 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 519 | } |
| 520 | |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 521 | bool LayerSupportBase::IsSwitchSupported(const TensorInfo& input0, |
| 522 | const TensorInfo& input1, |
| 523 | const TensorInfo& output0, |
| 524 | const TensorInfo& output1, |
| 525 | Optional<std::string&> reasonIfUnsupported) const |
| 526 | { |
| 527 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 528 | } |
| 529 | |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 530 | bool LayerSupportBase::IsTransposeConvolution2dSupported(const TensorInfo& input, |
| 531 | const TensorInfo& output, |
| 532 | const TransposeConvolution2dDescriptor& descriptor, |
| 533 | const TensorInfo& weights, |
| 534 | const Optional<TensorInfo>& biases, |
| 535 | Optional<std::string&> reasonIfUnsupported) const |
| 536 | { |
| 537 | return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported); |
| 538 | } |
| 539 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 540 | } // namespace armnn |