From acce504ec4aebe5e5da470c1cfc3cee401ff11f3 Mon Sep 17 00:00:00 2001 From: giuros01 Date: Thu, 21 Feb 2019 17:32:34 +0000 Subject: COMPMID-1740: Fuse batch normalization with Convolution Layer at graph level Change-Id: I77ca51c2c72783cc26a099a6a9c3210cdbbe822d Signed-off-by: giuros01 Reviewed-on: https://review.mlplatform.org/c/797 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Georgios Pinitas --- src/graph/backends/NEON/NEFunctionFactory.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/graph/backends/NEON/NEFunctionFactory.cpp') diff --git a/src/graph/backends/NEON/NEFunctionFactory.cpp b/src/graph/backends/NEON/NEFunctionFactory.cpp index dc987dd86e..f23845c314 100644 --- a/src/graph/backends/NEON/NEFunctionFactory.cpp +++ b/src/graph/backends/NEON/NEFunctionFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -46,7 +46,8 @@ namespace backends /** Target specific information structure used to pass information to the layer templates */ struct NETargetInfo { - using TensorType = arm_compute::ITensor; + using TensorType = arm_compute::ITensor; + using TensorConcreteType = arm_compute::Tensor; static Target TargetType; }; @@ -76,6 +77,13 @@ struct NEEltwiseFunctions using Multiplication = NEPixelWiseMultiplication; }; +/** Function and tensor types to be used inside a NEON fused convolution/batch normalization layer */ +struct NEFusedLayerTypes +{ + using ConvolutionLayer = NEConvolutionLayer; + using FuseBatchNormalization = NEFuseBatchNormalization; +}; + namespace detail { // Specialized functions @@ -210,6 +218,8 @@ std::unique_ptr NEFunctionFactory::create(INode *node, GraphContext & return detail::create_flatten_layer(*polymorphic_downcast(node)); case NodeType::FullyConnectedLayer: return detail::create_fully_connected_layer(*polymorphic_downcast(node), ctx); + case NodeType::FusedConvolutionBatchNormalizationLayer: + return detail::create_fused_convolution_batch_normalization_layer(*polymorphic_downcast(node)); case NodeType::NormalizationLayer: return detail::create_normalization_layer(*polymorphic_downcast(node), ctx); case NodeType::PermuteLayer: -- cgit v1.2.1