David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 7 | #include <armnn/Deprecated.hpp> |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 8 | #include <armnn/DescriptorsFwd.hpp> |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 9 | #include <armnn/LstmParams.hpp> |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 10 | #include <armnn/Optional.hpp> |
| 11 | #include <armnn/QuantizedLstmParams.hpp> |
Matthew Bentham | 313e1c8 | 2019-03-25 17:37:47 +0000 | [diff] [blame] | 12 | |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 13 | #include <cctype> |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 14 | #include <functional> |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 15 | #include <memory> |
Matthew Bentham | 313e1c8 | 2019-03-25 17:37:47 +0000 | [diff] [blame] | 16 | #include <vector> |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 17 | |
| 18 | namespace armnn |
| 19 | { |
| 20 | |
| 21 | class TensorInfo; |
| 22 | |
| 23 | class ILayerSupport |
| 24 | { |
| 25 | protected: |
| 26 | ILayerSupport() {} |
| 27 | virtual ~ILayerSupport() {} |
| 28 | |
| 29 | public: |
Kevin May | 868eb14 | 2019-09-04 17:29:31 +0100 | [diff] [blame^] | 30 | virtual bool IsAbsSupported(const TensorInfo& input, |
| 31 | const TensorInfo& output, |
| 32 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 33 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 34 | virtual bool IsActivationSupported(const TensorInfo& input, |
| 35 | const TensorInfo& output, |
| 36 | const ActivationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 37 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 38 | |
| 39 | virtual bool IsAdditionSupported(const TensorInfo& input0, |
| 40 | const TensorInfo& input1, |
| 41 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 42 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 43 | |
| 44 | virtual bool IsBatchNormalizationSupported(const TensorInfo& input, |
| 45 | const TensorInfo& output, |
| 46 | const TensorInfo& mean, |
| 47 | const TensorInfo& var, |
| 48 | const TensorInfo& beta, |
| 49 | const TensorInfo& gamma, |
| 50 | const BatchNormalizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 51 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 52 | |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 53 | virtual bool IsBatchToSpaceNdSupported(const TensorInfo& input, |
| 54 | const TensorInfo& output, |
| 55 | const BatchToSpaceNdDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 56 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 57 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 58 | virtual bool IsConcatSupported(const std::vector<const TensorInfo*> inputs, |
| 59 | const TensorInfo& output, |
| 60 | const OriginsDescriptor& descriptor, |
| 61 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 62 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 63 | virtual bool IsConstantSupported(const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 64 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 65 | |
| 66 | virtual bool IsConvertFp16ToFp32Supported(const TensorInfo& input, |
| 67 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 68 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 69 | |
| 70 | virtual bool IsConvertFp32ToFp16Supported(const TensorInfo& input, |
| 71 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 72 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 73 | |
| 74 | virtual bool IsConvolution2dSupported(const TensorInfo& input, |
| 75 | const TensorInfo& output, |
| 76 | const Convolution2dDescriptor& descriptor, |
| 77 | const TensorInfo& weights, |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 78 | const Optional<TensorInfo>& biases, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 79 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 80 | |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 81 | virtual bool IsDebugSupported(const TensorInfo& input, |
| 82 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 83 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 84 | |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 85 | virtual bool IsDepthwiseConvolutionSupported( |
| 86 | const TensorInfo& input, |
| 87 | const TensorInfo& output, |
| 88 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 89 | const TensorInfo& weights, |
| 90 | const Optional<TensorInfo>& biases, |
| 91 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 92 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 93 | virtual bool IsDequantizeSupported(const TensorInfo& input, |
| 94 | const TensorInfo& output, |
| 95 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 96 | |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 97 | virtual bool IsDetectionPostProcessSupported( |
| 98 | const TensorInfo& input0, |
| 99 | const TensorInfo& input1, |
| 100 | const DetectionPostProcessDescriptor& descriptor, |
| 101 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 102 | |
Pablo Tello | f0bd683 | 2019-04-26 17:58:13 +0100 | [diff] [blame] | 103 | virtual bool IsDilatedDepthwiseConvolutionSupported( |
| 104 | const TensorInfo& input, |
| 105 | const TensorInfo& output, |
| 106 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 107 | const TensorInfo& weights, |
| 108 | const Optional<TensorInfo>& biases, |
| 109 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 110 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 111 | virtual bool IsDivisionSupported(const TensorInfo& input0, |
| 112 | const TensorInfo& input1, |
| 113 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 114 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 115 | |
FrancisMurtagh | 2099595 | 2018-12-17 12:11:36 +0000 | [diff] [blame] | 116 | virtual bool IsEqualSupported(const TensorInfo& input0, |
| 117 | const TensorInfo& input1, |
| 118 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 119 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
FrancisMurtagh | 2099595 | 2018-12-17 12:11:36 +0000 | [diff] [blame] | 120 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 121 | virtual bool IsFakeQuantizationSupported(const TensorInfo& input, |
| 122 | const FakeQuantizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 123 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 124 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 125 | virtual bool IsFloorSupported(const TensorInfo& input, |
| 126 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 127 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 128 | |
| 129 | virtual bool IsFullyConnectedSupported(const TensorInfo& input, |
| 130 | const TensorInfo& output, |
| 131 | const TensorInfo& weights, |
| 132 | const TensorInfo& biases, |
| 133 | const FullyConnectedDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 134 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 135 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 136 | virtual bool IsGatherSupported(const TensorInfo& input0, |
| 137 | const TensorInfo& input1, |
| 138 | const TensorInfo& output, |
| 139 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 140 | |
Matteo Martincigh | 3d6898c | 2019-01-15 16:11:44 +0000 | [diff] [blame] | 141 | virtual bool IsGreaterSupported(const TensorInfo& input0, |
| 142 | const TensorInfo& input1, |
| 143 | const TensorInfo& ouput, |
| 144 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 145 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 146 | virtual bool IsInputSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 147 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 148 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 149 | virtual bool IsL2NormalizationSupported(const TensorInfo& input, |
| 150 | const TensorInfo& output, |
| 151 | const L2NormalizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 152 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 153 | |
| 154 | virtual bool IsLstmSupported(const TensorInfo& input, |
| 155 | const TensorInfo& outputStateIn, |
| 156 | const TensorInfo& cellStateIn, |
| 157 | const TensorInfo& scratchBuffer, |
| 158 | const TensorInfo& outputStateOut, |
| 159 | const TensorInfo& cellStateOut, |
| 160 | const TensorInfo& output, |
| 161 | const LstmDescriptor& descriptor, |
Jan Eilers | d01a83c | 2019-07-03 18:20:40 +0100 | [diff] [blame] | 162 | const LstmInputParamsInfo& paramsInfo, |
| 163 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 164 | |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 165 | virtual bool IsMaximumSupported(const TensorInfo& input0, |
| 166 | const TensorInfo& input1, |
| 167 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 168 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 169 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 170 | virtual bool IsMeanSupported(const TensorInfo& input, |
| 171 | const TensorInfo& output, |
| 172 | const MeanDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 173 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 174 | |
| 175 | virtual bool IsMemCopySupported(const TensorInfo& input, |
| 176 | const TensorInfo& output, |
| 177 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 178 | |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 179 | virtual bool IsMemImportSupported(const TensorInfo& input, |
| 180 | const TensorInfo& output, |
| 181 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 182 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 183 | virtual bool IsMergeSupported(const TensorInfo& input0, |
| 184 | const TensorInfo& input1, |
| 185 | const TensorInfo& output, |
| 186 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 187 | |
Jim Flynn | 906f946 | 2019-05-10 13:55:21 +0100 | [diff] [blame] | 188 | ARMNN_DEPRECATED_MSG("Use IsConcatSupported instead") |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 189 | virtual bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, |
Nikhil Raj | 8599a41 | 2018-11-19 14:51:07 +0000 | [diff] [blame] | 190 | const TensorInfo& output, |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 191 | const OriginsDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 192 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 193 | |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 194 | virtual bool IsMinimumSupported(const TensorInfo& input0, |
| 195 | const TensorInfo& input1, |
| 196 | const TensorInfo& ouput, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 197 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 198 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 199 | virtual bool IsMultiplicationSupported(const TensorInfo& input0, |
| 200 | const TensorInfo& input1, |
| 201 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 202 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 203 | |
| 204 | virtual bool IsNormalizationSupported(const TensorInfo& input, |
| 205 | const TensorInfo& output, |
| 206 | const NormalizationDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 207 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 208 | |
| 209 | virtual bool IsOutputSupported(const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 210 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 211 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 212 | virtual bool IsPadSupported(const TensorInfo& input, |
| 213 | const TensorInfo& output, |
| 214 | const PadDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 215 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 216 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 217 | virtual bool IsPermuteSupported(const TensorInfo& input, |
| 218 | const TensorInfo& output, |
| 219 | const PermuteDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 220 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 221 | |
| 222 | virtual bool IsPooling2dSupported(const TensorInfo& input, |
| 223 | const TensorInfo& output, |
| 224 | const Pooling2dDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 225 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 226 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 227 | virtual bool IsPreCompiledSupported(const TensorInfo& input, |
| 228 | const PreCompiledDescriptor& descriptor, |
| 229 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 230 | |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 231 | virtual bool IsPreluSupported(const TensorInfo& input, |
| 232 | const TensorInfo& alpha, |
| 233 | const TensorInfo& output, |
| 234 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 235 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 236 | virtual bool IsQuantizeSupported(const TensorInfo& input, |
| 237 | const TensorInfo& output, |
| 238 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 239 | |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 240 | virtual bool IsQuantizedLstmSupported(const TensorInfo& input, |
| 241 | const TensorInfo& previousCellStateIn, |
| 242 | const TensorInfo& previousOutputIn, |
| 243 | const TensorInfo& cellStateOut, |
| 244 | const TensorInfo& output, |
| 245 | const QuantizedLstmInputParamsInfo& paramsInfo, |
| 246 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 247 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 248 | virtual bool IsReshapeSupported(const TensorInfo& input, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 249 | const ReshapeDescriptor& descriptor, |
| 250 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 251 | |
Aron Virginas-Tar | 169d2f1 | 2019-07-01 19:01:44 +0100 | [diff] [blame] | 252 | ARMNN_DEPRECATED_MSG("Use IsResizeSupported instead") |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 253 | virtual bool IsResizeBilinearSupported(const TensorInfo& input, |
Sadik Armagan | c625f00 | 2018-12-17 11:32:16 +0000 | [diff] [blame] | 254 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 255 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 256 | |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 257 | virtual bool IsResizeSupported(const TensorInfo& input, |
| 258 | const TensorInfo& output, |
| 259 | const ResizeDescriptor& descriptor, |
| 260 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 261 | |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 262 | virtual bool IsRsqrtSupported(const TensorInfo& input, |
| 263 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 264 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 265 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 266 | virtual bool IsSoftmaxSupported(const TensorInfo& input, |
| 267 | const TensorInfo& output, |
| 268 | const SoftmaxDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 269 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 270 | |
Derek Lamberti | 61f5463 | 2019-03-25 16:28:44 +0000 | [diff] [blame] | 271 | virtual bool IsSpaceToBatchNdSupported(const TensorInfo& input, |
| 272 | const TensorInfo& output, |
| 273 | const SpaceToBatchNdDescriptor& descriptor, |
| 274 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 275 | |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 276 | virtual bool IsSpaceToDepthSupported(const TensorInfo& input, |
| 277 | const TensorInfo& output, |
| 278 | const SpaceToDepthDescriptor& descriptor, |
| 279 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 280 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 281 | ARMNN_DEPRECATED_MSG("Use IsSplitterSupported with outputs instead") |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 282 | virtual bool IsSplitterSupported(const TensorInfo& input, |
| 283 | const ViewsDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 284 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 285 | |
Narumol Prangnawarat | 15eb583 | 2019-05-20 15:31:05 +0100 | [diff] [blame] | 286 | virtual bool IsSplitterSupported(const TensorInfo& input, |
| 287 | const std::vector<std::reference_wrapper<TensorInfo>>& outputs, |
| 288 | const ViewsDescriptor& descriptor, |
| 289 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 290 | |
Matthew Jackson | 81e601c | 2019-07-11 12:07:09 +0100 | [diff] [blame] | 291 | virtual bool IsStackSupported(const std::vector<const TensorInfo*>& inputs, |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 292 | const TensorInfo& output, |
| 293 | const StackDescriptor& descriptor, |
| 294 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 295 | |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 296 | virtual bool IsStridedSliceSupported(const TensorInfo& input, |
| 297 | const TensorInfo& output, |
| 298 | const StridedSliceDescriptor& descriptor, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 299 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 300 | |
arovir01 | 537a0b6 | 2018-10-08 12:01:04 +0100 | [diff] [blame] | 301 | virtual bool IsSubtractionSupported(const TensorInfo& input0, |
| 302 | const TensorInfo& input1, |
| 303 | const TensorInfo& output, |
Matteo Martincigh | 992d6dc | 2019-01-10 17:34:20 +0000 | [diff] [blame] | 304 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 305 | |
| 306 | virtual bool IsSwitchSupported(const TensorInfo& input0, |
| 307 | const TensorInfo& input1, |
| 308 | const TensorInfo& output0, |
| 309 | const TensorInfo& output1, |
| 310 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 311 | |
| 312 | virtual bool IsTransposeConvolution2dSupported( |
| 313 | const TensorInfo& input, |
| 314 | const TensorInfo& output, |
| 315 | const TransposeConvolution2dDescriptor& descriptor, |
| 316 | const TensorInfo& weights, |
| 317 | const Optional<TensorInfo>& biases, |
| 318 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; |
| 319 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 320 | }; // class ILayerSupport |
| 321 | |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 322 | using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport>; |
| 323 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 324 | } // namespace armnn |