Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 ARM Limited. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 24 | #include "arm_compute/graph/backends/GLES/GCFunctionFactory.h" |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 25 | |
| 26 | #include "arm_compute/core/utils/misc/Cast.h" |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 27 | #include "arm_compute/graph/Graph.h" |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 28 | #include "arm_compute/graph/backends/FunctionHelpers.h" |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 29 | #include "arm_compute/runtime/GLES_COMPUTE/GCFunctions.h" |
| 30 | |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 31 | using namespace arm_compute::utils::cast; |
| 32 | |
| 33 | namespace arm_compute |
| 34 | { |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 35 | namespace graph |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 36 | { |
| 37 | namespace backends |
| 38 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 39 | /** Target specific information structure used to pass information to the layer templates */ |
| 40 | struct GCTargetInfo |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 41 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 42 | using TensorType = arm_compute::IGCTensor; |
| 43 | static Target TargetType; |
| 44 | }; |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 45 | |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 46 | Target GCTargetInfo::TargetType = Target::GC; |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 47 | |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 48 | /** Collection of GC convolution functions */ |
| 49 | struct GCConvolutionLayerFunctions |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 50 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 51 | using GenericConvolutionLayer = GCConvolutionLayer; |
| 52 | using GEMMConvolutionLayer = GCConvolutionLayer; |
| 53 | using DirectConvolutionLayer = GCDirectConvolutionLayer; |
| 54 | }; |
| 55 | |
| 56 | /** Collection of GC depthwise convolution functions */ |
| 57 | struct GCDepthwiseConvolutionLayerFunctions |
| 58 | { |
| 59 | using DepthwiseConvolutionLayer3x3 = GCDepthwiseConvolutionLayer3x3; |
| 60 | }; |
| 61 | |
| 62 | /** Collection of GC element-wise functions */ |
| 63 | struct GCEltwiseFunctions |
| 64 | { |
| 65 | using Addition = GCArithmeticAddition; |
| 66 | using Multiplication = GCPixelWiseMultiplication; |
| 67 | }; |
| 68 | |
| 69 | namespace detail |
| 70 | { |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 71 | // Specialize functions |
| 72 | template <> |
| 73 | std::unique_ptr<IFunction> create_concatenate_layer<GCDepthConcatenateLayer, GCTargetInfo>(ConcatenateLayerNode &node) |
| 74 | { |
| 75 | ARM_COMPUTE_LOG_GRAPH_VERBOSE("Creating Concatenate node with ID : " << node.id() << " and Name: " << node.name() << std::endl); |
| 76 | ARM_COMPUTE_ERROR_ON(node.num_outputs() != 1); |
| 77 | |
| 78 | // Return nullptr if depth concatenate is switched off |
| 79 | if(!node.is_enabled()) |
| 80 | { |
| 81 | return nullptr; |
| 82 | } |
| 83 | |
| 84 | // Extract IO and info |
| 85 | std::vector<GCTargetInfo::TensorType *> inputs; |
| 86 | for(unsigned int i = 0; i < node.num_inputs(); ++i) |
| 87 | { |
| 88 | inputs.push_back(get_backing_tensor<GCTargetInfo>(node.input(i))); |
| 89 | } |
| 90 | typename GCTargetInfo::TensorType *output = get_backing_tensor<GCTargetInfo>(node.output(0)); |
| 91 | |
| 92 | // Create and configure function |
| 93 | auto func = support::cpp14::make_unique<GCDepthConcatenateLayer>(); |
| 94 | func->configure(inputs, output); |
| 95 | |
| 96 | // Log info |
| 97 | ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.type() |
| 98 | << " Target " << GCTargetInfo::TargetType |
| 99 | << " Data Type: " << output->info()->data_type() |
| 100 | << " Shape: " << output->info()->tensor_shape() |
| 101 | << " Num Inputs: " << inputs.size() |
| 102 | << std::endl); |
| 103 | |
| 104 | return std::move(func); |
| 105 | } |
| 106 | |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 107 | template <> |
| 108 | std::unique_ptr<IFunction> create_convolution_layer<GCConvolutionLayerFunctions, GCTargetInfo>(ConvolutionLayerNode &node, GraphContext &ctx) |
| 109 | { |
| 110 | validate_node<GCTargetInfo>(node, 3 /* expected inputs */, 1 /* expected outputs */); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 111 | |
| 112 | // Extract IO and info |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 113 | GCTargetInfo::TensorType *input = get_backing_tensor<GCTargetInfo>(node.input(0)); |
| 114 | GCTargetInfo::TensorType *weights = get_backing_tensor<GCTargetInfo>(node.input(1)); |
| 115 | GCTargetInfo::TensorType *biases = get_backing_tensor<GCTargetInfo>(node.input(2)); |
| 116 | GCTargetInfo::TensorType *output = get_backing_tensor<GCTargetInfo>(node.output(0)); |
Giorgio Arena | bb54e4e | 2018-04-05 17:20:34 +0100 | [diff] [blame] | 117 | |
| 118 | if(is_data_type_quantized_asymmetric(input->info()->data_type())) |
| 119 | { |
| 120 | biases->info()->set_data_type(DataType::S32); |
| 121 | } |
| 122 | |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 123 | const PadStrideInfo conv_info = node.convolution_info(); |
| 124 | const ConvolutionMethod conv_algorithm = node.convolution_method(); |
| 125 | |
| 126 | // Create and configure function (we assume that functions have been validated before creation) |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 127 | std::shared_ptr<IMemoryManager> mm = get_memory_manager(ctx, GCTargetInfo::TargetType); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 128 | std::unique_ptr<IFunction> func; |
| 129 | std::string func_name; |
| 130 | |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 131 | if(conv_algorithm == ConvolutionMethod::Direct) |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 132 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 133 | std::tie(func, func_name) = create_named_function<GCConvolutionLayerFunctions::DirectConvolutionLayer>( |
| 134 | std::string("DirectConvolutionLayer"), |
| 135 | input, weights, biases, output, conv_info); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 136 | } |
| 137 | else |
| 138 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 139 | std::tie(func, func_name) = create_named_memory_managed_function<GCConvolutionLayerFunctions::GenericConvolutionLayer>( |
| 140 | std::string("ConvolutionLayer"), mm, |
| 141 | input, weights, biases, output, conv_info); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | // Log info |
| 145 | ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << func_name |
| 146 | << " Data Type: " << input->info()->data_type() |
Giorgio Arena | bb54e4e | 2018-04-05 17:20:34 +0100 | [diff] [blame] | 147 | << " Input QuantInfo: " << input->info()->quantization_info() |
| 148 | << " Weights QuantInfo: " << weights->info()->quantization_info() |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 149 | << " Input shape: " << input->info()->tensor_shape() |
| 150 | << " Weights shape: " << weights->info()->tensor_shape() |
| 151 | << " Output shape: " << output->info()->tensor_shape() |
| 152 | << std::endl); |
| 153 | return func; |
| 154 | } |
| 155 | |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 156 | template <> |
| 157 | std::unique_ptr<IFunction> create_depthwise_convolution_layer<GCDepthwiseConvolutionLayerFunctions, GCTargetInfo>(DepthwiseConvolutionLayerNode &node) |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 158 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 159 | validate_node<GCTargetInfo>(node, 3 /* expected inputs */, 1 /* expected outputs */); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 160 | |
| 161 | // Extract IO and info |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 162 | GCTargetInfo::TensorType *input = get_backing_tensor<GCTargetInfo>(node.input(0)); |
| 163 | GCTargetInfo::TensorType *weights = get_backing_tensor<GCTargetInfo>(node.input(1)); |
| 164 | GCTargetInfo::TensorType *biases = get_backing_tensor<GCTargetInfo>(node.input(2)); |
| 165 | GCTargetInfo::TensorType *output = get_backing_tensor<GCTargetInfo>(node.output(0)); |
Giorgio Arena | bb54e4e | 2018-04-05 17:20:34 +0100 | [diff] [blame] | 166 | |
| 167 | if(is_data_type_quantized_asymmetric(input->info()->data_type())) |
| 168 | { |
| 169 | biases->info()->set_data_type(DataType::S32); |
| 170 | } |
| 171 | |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 172 | const PadStrideInfo conv_info = node.convolution_info(); |
| 173 | const DepthwiseConvolutionMethod dwc_algorithm = node.depthwise_convolution_method(); |
| 174 | |
| 175 | // Create and configure function (we assume that functions have been validated before creation) |
| 176 | std::unique_ptr<IFunction> func; |
| 177 | std::string func_name; |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 178 | if(dwc_algorithm == DepthwiseConvolutionMethod::Optimized3x3) |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 179 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 180 | std::tie(func, func_name) = create_named_function<GCDepthwiseConvolutionLayerFunctions::DepthwiseConvolutionLayer3x3>( |
| 181 | std::string("DepthwiseConvolutionLayer3x3"), |
| 182 | input, weights, biases, output, conv_info); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 183 | } |
| 184 | else |
| 185 | { |
| 186 | ARM_COMPUTE_ERROR("Generic DepthwiseConvolutionLayer is not supported in GLES backend"); |
| 187 | } |
| 188 | |
| 189 | // Log info |
| 190 | ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << func_name |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 191 | << " Target " << GCTargetInfo::TargetType |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 192 | << " Data Type: " << input->info()->data_type() |
Giorgio Arena | bb54e4e | 2018-04-05 17:20:34 +0100 | [diff] [blame] | 193 | << " Input QuantInfo: " << input->info()->quantization_info() |
| 194 | << " Weights QuantInfo: " << weights->info()->quantization_info() |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 195 | << " Input shape: " << input->info()->tensor_shape() |
| 196 | << " Weights shape: " << weights->info()->tensor_shape() |
| 197 | << " Output shape: " << output->info()->tensor_shape() |
| 198 | << std::endl); |
| 199 | return func; |
| 200 | } |
| 201 | |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 202 | template <> |
| 203 | std::unique_ptr<IFunction> create_eltwise_layer<GCEltwiseFunctions, GCTargetInfo>(EltwiseLayerNode &node) |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 204 | { |
| 205 | ARM_COMPUTE_LOG_GRAPH_VERBOSE( |
| 206 | "Creating GC EltwiseLayer node with ID : " << node.id() << " and Name: " << node.name() << std::endl); |
| 207 | ARM_COMPUTE_ERROR_ON(node.num_inputs() != 2); |
| 208 | ARM_COMPUTE_ERROR_ON(node.num_outputs() != 1); |
| 209 | |
| 210 | // Extract IO and info |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 211 | GCTargetInfo::TensorType *input1 = get_backing_tensor<GCTargetInfo>(node.input(0)); |
| 212 | GCTargetInfo::TensorType *input2 = get_backing_tensor<GCTargetInfo>(node.input(1)); |
| 213 | GCTargetInfo::TensorType *output = get_backing_tensor<GCTargetInfo>(node.output(0)); |
| 214 | const EltwiseOperation eltwise_op = node.eltwise_operation(); |
| 215 | const ConvertPolicy convert_policy = node.convert_policy(); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 216 | ARM_COMPUTE_ERROR_ON(input1 == nullptr); |
| 217 | ARM_COMPUTE_ERROR_ON(input2 == nullptr); |
| 218 | ARM_COMPUTE_ERROR_ON(output == nullptr); |
| 219 | |
| 220 | std::unique_ptr<IFunction> func = nullptr; |
| 221 | std::string func_name; |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 222 | if(eltwise_op == EltwiseOperation::Add) |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 223 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 224 | std::tie(func, func_name) = create_named_function<GCEltwiseFunctions::Addition>( |
| 225 | std::string("GCArithmeticAddition"), |
| 226 | input1, input2, output, convert_policy); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 227 | } |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 228 | else if(eltwise_op == EltwiseOperation::Sub) |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 229 | { |
| 230 | ARM_COMPUTE_ERROR("Arithmetic subtraction is not supported in GLES backend"); |
| 231 | } |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 232 | else if(eltwise_op == EltwiseOperation::Mul) |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 233 | { |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 234 | std::tie(func, func_name) = create_named_function<GCEltwiseFunctions::Multiplication>( |
| 235 | std::string("PixelWiseMultiplication"), |
| 236 | input1, input2, output, 1.f); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 237 | } |
| 238 | else |
| 239 | { |
| 240 | ARM_COMPUTE_ERROR("Unsupported element-wise operation!"); |
| 241 | } |
| 242 | |
| 243 | // Log info |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 244 | ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.type() |
| 245 | << " Target " << GCTargetInfo::TargetType |
| 246 | << " Operation " << func_name |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 247 | << " Data Type: " << input1->info()->data_type() |
| 248 | << " Shape : " << input1->info()->tensor_shape() |
| 249 | << std::endl); |
| 250 | |
| 251 | return func; |
| 252 | } |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 253 | } //namespace detail |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 254 | |
| 255 | std::unique_ptr<IFunction> GCFunctionFactory::create(INode *node, GraphContext &ctx) |
| 256 | { |
| 257 | if(node == nullptr) |
| 258 | { |
| 259 | return nullptr; |
| 260 | } |
| 261 | |
| 262 | NodeType type = node->type(); |
| 263 | switch(type) |
| 264 | { |
| 265 | case NodeType::ActivationLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 266 | return detail::create_activation_layer<GCActivationLayer, GCTargetInfo>(*polymorphic_downcast<ActivationLayerNode *>(node)); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 267 | case NodeType::BatchNormalizationLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 268 | return detail::create_batch_normalization_layer<GCBatchNormalizationLayer, GCTargetInfo>(*polymorphic_downcast<BatchNormalizationLayerNode *>(node)); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 269 | case NodeType::ConvolutionLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 270 | return detail::create_convolution_layer<GCConvolutionLayerFunctions, GCTargetInfo>(*polymorphic_downcast<ConvolutionLayerNode *>(node), ctx); |
Georgios Pinitas | e222055 | 2018-07-20 13:23:44 +0100 | [diff] [blame] | 271 | case NodeType::ConcatenateLayer: |
| 272 | return detail::create_concatenate_layer<GCDepthConcatenateLayer, GCTargetInfo>(*polymorphic_downcast<ConcatenateLayerNode *>(node)); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 273 | case NodeType::DepthwiseConvolutionLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 274 | return detail::create_depthwise_convolution_layer<GCDepthwiseConvolutionLayerFunctions, GCTargetInfo>(*polymorphic_downcast<DepthwiseConvolutionLayerNode *>(node)); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 275 | case NodeType::EltwiseLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 276 | return detail::create_eltwise_layer<GCEltwiseFunctions, GCTargetInfo>(*polymorphic_downcast<EltwiseLayerNode *>(node)); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 277 | case NodeType::FullyConnectedLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 278 | return detail::create_fully_connected_layer<GCFullyConnectedLayer, GCTargetInfo>(*polymorphic_downcast<FullyConnectedLayerNode *>(node), ctx); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 279 | case NodeType::NormalizationLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 280 | return detail::create_normalization_layer<GCNormalizationLayer, GCTargetInfo>(*polymorphic_downcast<NormalizationLayerNode *>(node), ctx); |
Michele Di Giorgio | 555d110 | 2018-09-12 13:51:59 +0100 | [diff] [blame^] | 281 | case NodeType::NormalizePlanarYUVLayer: |
| 282 | return detail::create_normalize_planar_yuv_layer<GCNormalizePlanarYUVLayer, GCTargetInfo>(*polymorphic_downcast<NormalizePlanarYUVLayerNode *>(node)); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 283 | case NodeType::PoolingLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 284 | return detail::create_pooling_layer<GCPoolingLayer, GCTargetInfo>(*polymorphic_downcast<PoolingLayerNode *>(node)); |
| 285 | case NodeType::ResizeLayer: |
| 286 | return detail::create_resize_layer<GCScale, GCTargetInfo>(*polymorphic_downcast<ResizeLayerNode *>(node)); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 287 | case NodeType::SoftmaxLayer: |
Georgios Pinitas | da2491f | 2018-06-01 17:49:09 +0100 | [diff] [blame] | 288 | return detail::create_softmax_layer<GCSoftmaxLayer, GCTargetInfo>(*polymorphic_downcast<SoftmaxLayerNode *>(node), ctx); |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 289 | default: |
| 290 | return nullptr; |
| 291 | } |
| 292 | } |
| 293 | } // namespace backends |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 294 | } // namespace graph |
Michele Di Giorgio | 555d110 | 2018-09-12 13:51:59 +0100 | [diff] [blame^] | 295 | } // namespace arm_compute |