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