diff options
Diffstat (limited to 'arm_compute/graph/backends/FunctionHelpers.h')
-rw-r--r-- | arm_compute/graph/backends/FunctionHelpers.h | 732 |
1 files changed, 285 insertions, 447 deletions
diff --git a/arm_compute/graph/backends/FunctionHelpers.h b/arm_compute/graph/backends/FunctionHelpers.h index 9830290d0f..fd8b6b5a69 100644 --- a/arm_compute/graph/backends/FunctionHelpers.h +++ b/arm_compute/graph/backends/FunctionHelpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Arm Limited. + * Copyright (c) 2018-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -21,22 +21,22 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_GRAPH_BACKENDS_DETAIL_FUNCTION_HELPERS_H -#define ARM_COMPUTE_GRAPH_BACKENDS_DETAIL_FUNCTION_HELPERS_H +#ifndef ACL_ARM_COMPUTE_GRAPH_BACKENDS_FUNCTIONHELPERS_H +#define ACL_ARM_COMPUTE_GRAPH_BACKENDS_FUNCTIONHELPERS_H +#include "arm_compute/core/Error.h" +#include "arm_compute/core/Helpers.h" +#include "arm_compute/core/ITensorInfo.h" +#include "arm_compute/graph/backends/FusedConvolutionBatchNormalizationFunction.h" +#include "arm_compute/graph/backends/FusedDepthwiseConvolutionBatchNormalizationFunction.h" +#include "arm_compute/graph/backends/Utils.h" #include "arm_compute/graph/Logger.h" +#include "arm_compute/graph/nodes/Nodes.h" #include "arm_compute/graph/Tensor.h" #include "arm_compute/graph/TypePrinter.h" #include "arm_compute/graph/Types.h" #include "arm_compute/graph/Utils.h" -#include "arm_compute/graph/backends/FusedConvolutionBatchNormalizationFunction.h" -#include "arm_compute/graph/backends/FusedDepthwiseConvolutionBatchNormalizationFunction.h" -#include "arm_compute/graph/backends/Utils.h" -#include "arm_compute/graph/nodes/Nodes.h" -#include "arm_compute/core/Error.h" -#include "arm_compute/core/Helpers.h" -#include "arm_compute/core/ITensorInfo.h" #include "support/Cast.h" namespace arm_compute @@ -59,13 +59,16 @@ template <typename TargetInfo> typename TargetInfo::TensorType *get_backing_tensor(arm_compute::graph::Tensor *tensor) { typename TargetInfo::TensorType *backing_tensor = nullptr; - if(tensor != nullptr) + if (tensor != nullptr) { ARM_COMPUTE_ERROR_ON(tensor->desc().target != TargetInfo::TargetType); // Get backing tensor handle ITensorHandle *tensor_handle = tensor->handle(); // Get backing tensor - backing_tensor = (tensor_handle != nullptr) ? arm_compute::utils::cast::polymorphic_cast<typename TargetInfo::TensorType *>(&tensor_handle->tensor()) : nullptr; + backing_tensor = (tensor_handle != nullptr) + ? arm_compute::utils::cast::polymorphic_cast<typename TargetInfo::TensorType *>( + &tensor_handle->tensor()) + : nullptr; } return backing_tensor; @@ -74,11 +77,8 @@ typename TargetInfo::TensorType *get_backing_tensor(arm_compute::graph::Tensor * template <typename TargetInfo> void validate_node(const INode &node, size_t num_expected_inputs, size_t num_expected_outputs) { - ARM_COMPUTE_LOG_GRAPH_VERBOSE("Creating " << node.type() - << " Target: " << TargetInfo::TargetType - << " ID: " << node.id() - << node.name() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Creating " << node.type() << " Target: " << TargetInfo::TargetType + << " ID: " << node.id() << node.name() << std::endl); ARM_COMPUTE_ERROR_ON(TargetInfo::TargetType != node.assigned_target()); ARM_COMPUTE_ERROR_ON(node.num_inputs() != num_expected_inputs); @@ -109,19 +109,13 @@ std::unique_ptr<IFunction> create_activation_layer(ActivationLayerNode &node) auto func = std::make_unique<ActivationLayerFunction>(); func->configure(input, output, act_info); - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Shape: " << input->info()->tensor_shape() - << " Activation function: " << act_info.activation() - << " a: " << act_info.a() - << " b: " << act_info.b() - << " InPlace : " << is_in_place_operation(input, output) - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO( + "Instantiated " << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << input->info()->data_type() << " Shape: " << input->info()->tensor_shape() + << " Activation function: " << act_info.activation() << " a: " << act_info.a() << " b: " + << act_info.b() << " InPlace : " << is_in_place_operation(input, output) << std::endl); - return std::move(func); + return func; } /** Creates a backend argminmax layer function @@ -148,17 +142,12 @@ std::unique_ptr<IFunction> create_arg_min_max_layer(ArgMinMaxLayerNode &node) auto func = std::make_unique<ArgMinMaxLayerFunction>(); func->configure(input, axis, output, op); - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Shape: " << input->info()->tensor_shape() - << " Reduction Operation: " << op - << " axis: " << axis - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Shape: " << input->info()->tensor_shape() + << " Reduction Operation: " << op << " axis: " << axis << std::endl); - return std::move(func); + return func; } /** Create a backend batch normalization layer function @@ -191,18 +180,13 @@ std::unique_ptr<IFunction> create_batch_normalization_layer(BatchNormalizationLa func->configure(input, output, mean, var, beta, gamma, epsilon, fused_act); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Shape: " << input->info()->tensor_shape() - << " Epsilon: " << epsilon << " " - << (fused_act.enabled() ? to_string(fused_act.activation()) : "") - << " InPlace: " << is_in_place_operation(input, output) - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Shape: " << input->info()->tensor_shape() << " Epsilon: " << epsilon + << " " << (fused_act.enabled() ? to_string(fused_act.activation()) : "") + << " InPlace: " << is_in_place_operation(input, output) << std::endl); - return std::move(func); + return func; } /** Create a backend batch normalization layer function @@ -216,7 +200,8 @@ std::unique_ptr<IFunction> create_batch_normalization_layer(BatchNormalizationLa * @return Backend batch normalization layer function */ template <typename FusedLayerTypes, typename TargetInfo> -std::unique_ptr<IFunction> create_fused_convolution_batch_normalization_layer(FusedConvolutionBatchNormalizationNode &node, GraphContext &ctx) +std::unique_ptr<IFunction> +create_fused_convolution_batch_normalization_layer(FusedConvolutionBatchNormalizationNode &node, GraphContext &ctx) { validate_node<TargetInfo>(node, 7 /* expected inputs */, 1 /* expected outputs */); @@ -246,20 +231,17 @@ std::unique_ptr<IFunction> create_fused_convolution_batch_normalization_layer(Fu // Create and configure function std::tie(func, func_name) = create_named_memory_managed_function<FType>( - std::string("FusedConvolutionBatchNormalizationLayer"), mm, input, weights, biases, output, mean, var, beta, gamma, epsilon, conv_info, num_groups, fast_math, fused_act); + std::string("FusedConvolutionBatchNormalizationLayer"), mm, input, weights, biases, output, mean, var, beta, + gamma, epsilon, conv_info, num_groups, fast_math, fused_act); // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Weights shape: " << weights->info()->tensor_shape() + << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << input->info()->data_type() << " Input shape: " + << input->info()->tensor_shape() << " Weights shape: " << weights->info()->tensor_shape() << " Output shape: " << output->info()->tensor_shape() - << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") - << std::endl); - return std::move(func); + << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") << std::endl); + return func; } /** Create a backend fused depthwise convolution batch normalization layer function @@ -273,7 +255,9 @@ std::unique_ptr<IFunction> create_fused_convolution_batch_normalization_layer(Fu * @return Backend fused depthwise convolution batch normalization layer function */ template <typename FusedLayerTypes, typename TargetInfo> -std::unique_ptr<IFunction> create_fused_depthwise_convolution_batch_normalization_layer(FusedDepthwiseConvolutionBatchNormalizationNode &node, GraphContext &ctx) +std::unique_ptr<IFunction> +create_fused_depthwise_convolution_batch_normalization_layer(FusedDepthwiseConvolutionBatchNormalizationNode &node, + GraphContext &ctx) { validate_node<TargetInfo>(node, 7 /* expected inputs */, 1 /* expected outputs */); @@ -302,20 +286,17 @@ std::unique_ptr<IFunction> create_fused_depthwise_convolution_batch_normalizatio // Create and configure function std::tie(func, func_name) = create_named_memory_managed_function<FType>( - std::string("FusedDepthwiseConvolutionBatchNormalizationLayer"), mm, input, weights, biases, output, mean, var, beta, gamma, epsilon, conv_info, depth_multiplier, fused_act); + std::string("FusedDepthwiseConvolutionBatchNormalizationLayer"), mm, input, weights, biases, output, mean, var, + beta, gamma, epsilon, conv_info, depth_multiplier, fused_act); // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Weights shape: " << weights->info()->tensor_shape() + << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << input->info()->data_type() << " Input shape: " + << input->info()->tensor_shape() << " Weights shape: " << weights->info()->tensor_shape() << " Output shape: " << output->info()->tensor_shape() - << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") - << std::endl); - return std::move(func); + << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") << std::endl); + return func; } /** Create a backend bounding box transform layer function @@ -343,15 +324,11 @@ std::unique_ptr<IFunction> create_bounding_box_transform_layer(BoundingBoxTransf func->configure(input, output, deltas, bbox_info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Shape: " << input->info()->tensor_shape() - << " BoundingBox Info img W: " << bbox_info.img_width() << " " - << " BoundingBox Info img H: " << bbox_info.img_height() << " " - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO( + "Instantiated " << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << input->info()->data_type() << " Shape: " << input->info()->tensor_shape() + << " BoundingBox Info img W: " << bbox_info.img_width() << " " + << " BoundingBox Info img H: " << bbox_info.img_height() << " " << std::endl); return std::move(func); } @@ -379,16 +356,12 @@ std::unique_ptr<IFunction> create_channel_shuffle_layer(ChannelShuffleLayerNode auto func = std::make_unique<ChannelShuffleLayerFunction>(); func->configure(input, output, num_groups); - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Shape: " << input->info()->tensor_shape() - << " Num groups: " << num_groups - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Shape: " << input->info()->tensor_shape() + << " Num groups: " << num_groups << std::endl); - return std::move(func); + return func; } /** Create a backend layer concatenate function @@ -403,24 +376,25 @@ std::unique_ptr<IFunction> create_channel_shuffle_layer(ChannelShuffleLayerNode template <typename ConcatenateLayerFunction, typename TargetInfo> std::unique_ptr<arm_compute::IFunction> create_concatenate_layer(ConcatenateLayerNode &node) { - ARM_COMPUTE_LOG_GRAPH_VERBOSE("Creating Concatenate node with ID : " << node.id() << " and Name: " << node.name() << std::endl); + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Creating Concatenate node with ID : " << node.id() << " and Name: " << node.name() + << std::endl); ARM_COMPUTE_ERROR_ON(node.num_outputs() != 1); // Return nullptr if depth concatenate is switched off - if(!node.is_enabled()) + if (!node.is_enabled()) { return nullptr; } // Extract IO and info std::vector<typename TargetInfo::SrcTensorType *> inputs; - for(unsigned int i = 0; i < node.num_inputs(); ++i) + for (unsigned int i = 0; i < node.num_inputs(); ++i) { inputs.push_back(get_backing_tensor<TargetInfo>(node.input(i))); } - typename TargetInfo::TensorType *output = get_backing_tensor<TargetInfo>(node.output(0)); - const DataLayout data_layout = node.output(0) != nullptr ? node.output(0)->desc().layout : DataLayout::UNKNOWN; - const size_t concat_axis = get_dimension_idx(data_layout, node.concatenation_axis()); + typename TargetInfo::TensorType *output = get_backing_tensor<TargetInfo>(node.output(0)); + const DataLayout data_layout = node.output(0) != nullptr ? node.output(0)->desc().layout : DataLayout::UNKNOWN; + const size_t concat_axis = get_dimension_idx(data_layout, node.concatenation_axis()); // Create and configure function auto func = std::make_unique<ConcatenateLayerFunction>(); @@ -429,28 +403,22 @@ std::unique_ptr<arm_compute::IFunction> create_concatenate_layer(ConcatenateLaye // Log info const bool is_quantized = is_data_type_quantized_asymmetric(output->info()->data_type()); std::ostringstream qss; - if(is_quantized) + if (is_quantized) { qss << " Output QuantInfo: " << output->info()->quantization_info(); } - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << output->info()->data_type() - << " Shape: " << output->info()->tensor_shape() - << " Num Inputs: " << inputs.size() - << " Axis: " << concat_axis - << qss.str() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO( + "Instantiated " << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << output->info()->data_type() << " Shape: " << output->info()->tensor_shape() + << " Num Inputs: " << inputs.size() << " Axis: " << concat_axis << qss.str() << std::endl); - return std::move(func); + return func; } /** Create a backend convolution layer function * * @tparam ConvolutionLayerFunctions Backend convolution functions - * @tparam TargetInfo Target-specific information + * @tparam TargetInfo Target-specific information * * @param[in] node Node to create the backend function for * @param[in] ctx Graph context @@ -470,7 +438,7 @@ std::unique_ptr<IFunction> create_convolution_layer(ConvolutionLayerNode &node, const bool is_quantized = is_data_type_quantized_asymmetric(input->info()->data_type()); - if(is_quantized) + if (is_quantized) { biases->info()->set_data_type(DataType::S32); } @@ -486,56 +454,51 @@ std::unique_ptr<IFunction> create_convolution_layer(ConvolutionLayerNode &node, std::unique_ptr<IFunction> func; std::string func_name; - if(conv_algorithm == ConvolutionMethod::Winograd) + if (conv_algorithm == ConvolutionMethod::Winograd) { ARM_COMPUTE_ERROR_ON_MSG(num_groups != 1, "WinogradConvolutionLayer does not support grouping!"); - std::tie(func, func_name) = create_named_memory_managed_function<typename ConvolutionLayerFunctions::WinogradConvolutionLayer>( - std::string("WinogradConvolutionLayer"), mm, - input, weights, biases, output, conv_info, fused_act, fast_math); + std::tie(func, func_name) = + create_named_memory_managed_function<typename ConvolutionLayerFunctions::WinogradConvolutionLayer>( + std::string("WinogradConvolutionLayer"), mm, input, weights, biases, output, conv_info, fused_act, + fast_math); } - else if(conv_algorithm == ConvolutionMethod::Direct) + else if (conv_algorithm == ConvolutionMethod::Direct) { ARM_COMPUTE_ERROR_ON_MSG(num_groups != 1, "DirectConvolutionLayer does not support grouping!"); std::tie(func, func_name) = create_named_function<typename ConvolutionLayerFunctions::DirectConvolutionLayer>( - std::string("DirectConvolutionLayer"), - input, weights, biases, output, conv_info, fused_act); + std::string("DirectConvolutionLayer"), input, weights, biases, output, conv_info, fused_act); } - else if(conv_algorithm == ConvolutionMethod::GEMM) + else if (conv_algorithm == ConvolutionMethod::GEMM) { - std::tie(func, func_name) = create_named_memory_managed_function<typename ConvolutionLayerFunctions::GEMMConvolutionLayer>( - std::string("GEMMConvolutionLayer"), mm, - input, weights, biases, output, conv_info, - WeightsInfo(), Size2D(1U, 1U), fused_act, num_groups); + std::tie(func, func_name) = + create_named_memory_managed_function<typename ConvolutionLayerFunctions::GEMMConvolutionLayer>( + std::string("GEMMConvolutionLayer"), mm, input, weights, biases, output, conv_info, WeightsInfo(), + Size2D(1U, 1U), fused_act, num_groups); } else { - std::tie(func, func_name) = create_named_memory_managed_function<typename ConvolutionLayerFunctions::GenericConvolutionLayer>( - std::string("GenericConvolutionLayer"), mm, - input, weights, biases, output, conv_info, - WeightsInfo(), Size2D(1U, 1U), fused_act, fast_math, num_groups); + std::tie(func, func_name) = + create_named_memory_managed_function<typename ConvolutionLayerFunctions::GenericConvolutionLayer>( + std::string("GenericConvolutionLayer"), mm, input, weights, biases, output, conv_info, WeightsInfo(), + Size2D(1U, 1U), fused_act, fast_math, num_groups); } // Log info std::ostringstream qss; - if(is_quantized) + if (is_quantized) { qss << " Input QuantInfo: " << input->info()->quantization_info() << " Weights QuantInfo: " << weights->info()->quantization_info() << " Output QuantInfo: " << output->info()->quantization_info(); } ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << func_name - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Groups: " << num_groups + << node.name() << " Type: " << func_name << " Target: " << TargetInfo::TargetType + << " Data Type: " << input->info()->data_type() << " Groups: " << num_groups << " Input shape: " << input->info()->tensor_shape() << " Weights shape: " << weights->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << qss.str() - << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") - << std::endl); - return std::move(func); + << " Output shape: " << output->info()->tensor_shape() << qss.str() + << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") << std::endl); + return func; } /** Create a backend deconvolution layer function @@ -566,19 +529,14 @@ std::unique_ptr<IFunction> create_deconvolution_layer(DeconvolutionLayerNode &no std::unique_ptr<IFunction> func; std::tie(func, std::ignore) = create_named_memory_managed_function<DeconvolutionLayerFunction>( - std::string(), mm, - input, weights, biases, output, deconv_info); + std::string(), mm, input, weights, biases, output, deconv_info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Weights shape: " << weights->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Weights shape: " << weights->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); return func; } @@ -604,7 +562,7 @@ std::unique_ptr<IFunction> create_depthwise_convolution_layer(DepthwiseConvoluti const bool is_quantized = is_data_type_quantized_asymmetric(input->info()->data_type()); - if(is_quantized) + if (is_quantized) { biases->info()->set_data_type(DataType::S32); } @@ -617,31 +575,26 @@ std::unique_ptr<IFunction> create_depthwise_convolution_layer(DepthwiseConvoluti std::unique_ptr<IFunction> func; std::string func_name; - std::tie(func, func_name) = create_named_function<DepthwiseConvolutionLayer>( - std::string("DepthwiseConvolutionLayer"), - input, weights, biases, output, conv_info, depth_multiplier, fused_act); + std::tie(func, func_name) = + create_named_function<DepthwiseConvolutionLayer>(std::string("DepthwiseConvolutionLayer"), input, weights, + biases, output, conv_info, depth_multiplier, fused_act); // Log info std::ostringstream qss; - if(is_quantized) + if (is_quantized) { qss << " Input QuantInfo: " << input->info()->quantization_info() << " Weights QuantInfo: " << weights->info()->quantization_info() << " Output QuantInfo: " << output->info()->quantization_info(); } ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << func_name - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Weights shape: " << weights->info()->tensor_shape() + << node.name() << " Type: " << func_name << " Target: " << TargetInfo::TargetType + << " Data Type: " << input->info()->data_type() << " Input shape: " + << input->info()->tensor_shape() << " Weights shape: " << weights->info()->tensor_shape() << " Output shape: " << output->info()->tensor_shape() - << " Depth multiplier: " << depth_multiplier - << qss.str() - << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") - << std::endl); - return std::move(func); + << " Depth multiplier: " << depth_multiplier << qss.str() + << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") << std::endl); + return func; } /** Create a backend depth to space layer function @@ -670,17 +623,13 @@ std::unique_ptr<IFunction> create_depth_to_space_layer(DepthToSpaceLayerNode &no func->configure(input, output, node.block_shape()); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Block Size: " << node.block_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Block Size: " << node.block_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend dequantize layer function @@ -709,17 +658,13 @@ std::unique_ptr<IFunction> create_dequantization_layer(DequantizationLayerNode & func->configure(input, output); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Input quantization info: " << output->info()->quantization_info() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Input quantization info: " << output->info()->quantization_info() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend detection output layer function * @@ -753,18 +698,14 @@ std::unique_ptr<IFunction> create_detection_output_layer(DetectionOutputLayerNod // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input0->info()->data_type() - << " Input0 shape: " << input0->info()->tensor_shape() - << " Input1 shape: " << input1->info()->tensor_shape() + << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << input0->info()->data_type() << " Input0 shape: " + << input0->info()->tensor_shape() << " Input1 shape: " << input1->info()->tensor_shape() << " Input2 shape: " << input2->info()->tensor_shape() << " Output shape: " << output->info()->tensor_shape() - << " DetectionOutputLayer info: " << detect_info - << std::endl); + << " DetectionOutputLayer info: " << detect_info << std::endl); - return std::move(func); + return func; } /** Create a backend detection post process layer function @@ -805,21 +746,17 @@ std::unique_ptr<IFunction> create_detection_post_process_layer(DetectionPostProc // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input0->info()->data_type() - << " Input0 shape: " << input0->info()->tensor_shape() - << " Input1 shape: " << input1->info()->tensor_shape() + << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << input0->info()->data_type() << " Input0 shape: " + << input0->info()->tensor_shape() << " Input1 shape: " << input1->info()->tensor_shape() << " Input2 shape: " << input2->info()->tensor_shape() << " Output0 shape: " << output0->info()->tensor_shape() << " Output1 shape: " << output1->info()->tensor_shape() << " Output2 shape: " << output2->info()->tensor_shape() << " Output3 shape: " << output3->info()->tensor_shape() - << " DetectionPostProcessLayer info: " << detect_info - << std::endl); + << " DetectionPostProcessLayer info: " << detect_info << std::endl); - return std::move(func); + return func; } /** Create a backend element-wise operation layer function @@ -849,35 +786,31 @@ std::unique_ptr<IFunction> create_eltwise_layer(EltwiseLayerNode &node) std::unique_ptr<IFunction> func = nullptr; std::string func_name; - if(eltwise_op == EltwiseOperation::Add) + if (eltwise_op == EltwiseOperation::Add) { std::tie(func, func_name) = create_named_function<typename EltwiseFunctions::Addition>( - std::string("ArithmeticAddition"), - input1, input2, output, convert_policy, act_info); + std::string("ArithmeticAddition"), input1, input2, output, convert_policy, act_info); } - else if(eltwise_op == EltwiseOperation::Sub) + else if (eltwise_op == EltwiseOperation::Sub) { std::tie(func, func_name) = create_named_function<typename EltwiseFunctions::Subtraction>( - std::string("ArithmeticSubtraction"), - input1, input2, output, convert_policy, act_info); + std::string("ArithmeticSubtraction"), input1, input2, output, convert_policy, act_info); } - else if(eltwise_op == EltwiseOperation::Mul) + else if (eltwise_op == EltwiseOperation::Mul) { std::tie(func, func_name) = create_named_function<typename EltwiseFunctions::Multiplication>( - std::string("PixelWiseMultiplication"), - input1, input2, output, 1.f, convert_policy, node.rounding_policy(), act_info); + std::string("PixelWiseMultiplication"), input1, input2, output, 1.f, convert_policy, node.rounding_policy(), + act_info); } - else if(eltwise_op == EltwiseOperation::Max) + else if (eltwise_op == EltwiseOperation::Max) { std::tie(func, func_name) = create_named_function<typename EltwiseFunctions::Maximum>( - std::string("ElementwiseMaximum"), - input1, input2, output, act_info); + std::string("ElementwiseMaximum"), input1, input2, output, act_info); } - else if(eltwise_op == EltwiseOperation::Div) + else if (eltwise_op == EltwiseOperation::Div) { std::tie(func, func_name) = create_named_function<typename EltwiseFunctions::Division>( - std::string("ArithmeticDivision"), - input1, input2, output, act_info); + std::string("ArithmeticDivision"), input1, input2, output, act_info); } else { @@ -885,16 +818,12 @@ std::unique_ptr<IFunction> create_eltwise_layer(EltwiseLayerNode &node) } // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Operation: " << func_name - << " Data Type: " << input1->info()->data_type() - << " Shape: " << input1->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() + << " Target: " << TargetInfo::TargetType << " Operation: " << func_name + << " Data Type: " << input1->info()->data_type() + << " Shape: " << input1->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend unary element-wise operation layer function @@ -921,11 +850,10 @@ std::unique_ptr<IFunction> create_unary_eltwise_layer(UnaryEltwiseLayerNode &nod std::unique_ptr<IFunction> func = nullptr; std::string func_name; - if(eltwise_op == UnaryEltwiseOperation::Exp) + if (eltwise_op == UnaryEltwiseOperation::Exp) { - std::tie(func, func_name) = create_named_function<typename UnaryEltwiseFunctions::Exp>( - std::string("Exp"), - input, output); + std::tie(func, func_name) = + create_named_function<typename UnaryEltwiseFunctions::Exp>(std::string("Exp"), input, output); } else { @@ -933,16 +861,12 @@ std::unique_ptr<IFunction> create_unary_eltwise_layer(UnaryEltwiseLayerNode &nod } // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Operation: " << func_name - << " Data Type: " << input->info()->data_type() - << " Shape: " << input->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() + << " Target: " << TargetInfo::TargetType << " Operation: " << func_name + << " Data Type: " << input->info()->data_type() + << " Shape: " << input->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend flatten layer function @@ -971,16 +895,12 @@ std::unique_ptr<IFunction> create_flatten_layer(FlattenLayerNode &node) func->configure(input, output); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend fully connected layer function @@ -1003,7 +923,8 @@ std::unique_ptr<IFunction> create_fully_connected_layer(FullyConnectedLayerNode typename TargetInfo::TensorType *weights = get_backing_tensor<TargetInfo>(node.input(1)); typename TargetInfo::TensorType *biases = get_backing_tensor<TargetInfo>(node.input(2)); typename TargetInfo::TensorType *output = get_backing_tensor<TargetInfo>(node.output(0)); - const FullyConnectedLayerInfo fc_info = node.info(); + FullyConnectedLayerInfo fc_info = node.info(); + fc_info.enable_fast_math = (node.fast_math_hint() == FastMathHint::Enabled); ARM_COMPUTE_ERROR_ON(input == nullptr); ARM_COMPUTE_ERROR_ON(weights == nullptr); @@ -1019,24 +940,19 @@ std::unique_ptr<IFunction> create_fully_connected_layer(FullyConnectedLayerNode // Log info std::ostringstream qss; - if(is_quantized) + if (is_quantized) { qss << " Input QuantInfo: " << input->info()->quantization_info() << " Weights QuantInfo: " << weights->info()->quantization_info() << " Output QuantInfo: " << output->info()->quantization_info(); } - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << qss.str() - << " Input shape: " << input->info()->tensor_shape() - << " Weights shape: " << weights->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << qss.str() << " Input shape: " << input->info()->tensor_shape() + << " Weights shape: " << weights->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend generate proposals layer function @@ -1074,16 +990,14 @@ std::unique_ptr<IFunction> create_generate_proposals_layer(GenerateProposalsLaye func->configure(scores, deltas, anchors, proposals, scores_out, num_valid_proposals, info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.type() - << " Target " << TargetInfo::TargetType - << " Data Type: " << scores->info()->data_type() - << " Scores shape: " << scores->info()->tensor_shape() + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " + << node.type() << " Target " << TargetInfo::TargetType << " Data Type: " + << scores->info()->data_type() << " Scores shape: " << scores->info()->tensor_shape() << " Deltas shape: " << deltas->info()->tensor_shape() << " Anchors shape: " << anchors->info()->tensor_shape() << " Proposals shape: " << proposals->info()->tensor_shape() << " Num valid proposals shape: " << num_valid_proposals->info()->tensor_shape() - << " Scores Out shape: " << scores_out->info()->tensor_shape() - << std::endl); + << " Scores Out shape: " << scores_out->info()->tensor_shape() << std::endl); return std::move(func); } @@ -1118,18 +1032,13 @@ std::unique_ptr<IFunction> create_l2_normalize_layer(L2NormalizeLayerNode &node, func->configure(input, output, axis, epsilon); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " Axis: " << axis - << " Epsilon: " << epsilon - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() + << " Axis: " << axis << " Epsilon: " << epsilon << std::endl); - return std::move(func); + return func; } /** Create a backend normalization layer function @@ -1161,15 +1070,11 @@ std::unique_ptr<IFunction> create_normalization_layer(NormalizationLayerNode &no func->configure(input, output, norm_info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " Normalization info: " << norm_info.type() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() + << " Normalization info: " << norm_info.type() << std::endl); return std::move(func); } @@ -1203,13 +1108,9 @@ std::unique_ptr<IFunction> create_normalize_planar_yuv_layer(NormalizePlanarYUVL func->configure(input, output, mean, std); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Shape: " << input->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Shape: " << input->info()->tensor_shape() << std::endl); return std::move(func); } @@ -1241,16 +1142,12 @@ std::unique_ptr<IFunction> create_pad_layer(PadLayerNode &node) func->configure(input, output, padding, pad_value); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend permute layer function @@ -1279,17 +1176,13 @@ std::unique_ptr<IFunction> create_permute_layer(PermuteLayerNode &node) func->configure(input, output, perm); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " Permutation vector: " << perm - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() + << " Permutation vector: " << perm << std::endl); - return std::move(func); + return func; } /** Create a backend pooling layer function @@ -1318,17 +1211,13 @@ std::unique_ptr<IFunction> create_pooling_layer(PoolingLayerNode &node) func->configure(input, output, pool_info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " Pooling info: " << pool_info.pool_type - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() + << " Pooling info: " << pool_info.pool_type << std::endl); - return std::move(func); + return func; } /** Create a backend PRelu layer function @@ -1357,16 +1246,12 @@ std::unique_ptr<IFunction> create_prelu_layer(PReluLayerNode &node) func->configure(input, alpha, output); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend print layer function @@ -1387,13 +1272,9 @@ std::unique_ptr<IFunction> create_print_layer(PrintLayerNode &node) ARM_COMPUTE_UNUSED(input); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() << std::endl); return nullptr; } @@ -1427,17 +1308,13 @@ std::unique_ptr<IFunction> create_priorbox_layer(PriorBoxLayerNode &node) // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input0->info()->data_type() - << " Input0 shape: " << input0->info()->tensor_shape() - << " Input1 shape: " << input1->info()->tensor_shape() + << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType + << " Data Type: " << input0->info()->data_type() << " Input0 shape: " + << input0->info()->tensor_shape() << " Input1 shape: " << input1->info()->tensor_shape() << " Output shape: " << output->info()->tensor_shape() - << " PriorBoxLayer info: " << prior_info - << std::endl); + << " PriorBoxLayer info: " << prior_info << std::endl); - return std::move(func); + return func; } /** Create a backend quantization layer function @@ -1465,16 +1342,12 @@ std::unique_ptr<IFunction> create_quantization_layer(QuantizationLayerNode &node func->configure(input, output); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend reduction operation layer function @@ -1507,18 +1380,13 @@ std::unique_ptr<IFunction> create_reduction_operation_layer(ReductionLayerNode & // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType + << node.name() << " Type: " << node.type() << " Target: " << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " Operation: " << op - << " Axis: " << axis - << " Keep dimensions:" << keep_dims - << std::endl); + << " Output shape: " << output->info()->tensor_shape() << " Operation: " << op + << " Axis: " << axis << " Keep dimensions:" << keep_dims << std::endl); - return std::move(func); + return func; } /** Create a backend reorg layer function @@ -1546,16 +1414,12 @@ std::unique_ptr<IFunction> create_reorg_layer(ReorgLayerNode &node) func->configure(input, output, node.stride()); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend reshape layer function @@ -1583,16 +1447,12 @@ std::unique_ptr<IFunction> create_reshape_layer(ReshapeLayerNode &node) func->configure(input, output); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend resize layer function @@ -1618,20 +1478,17 @@ std::unique_ptr<IFunction> create_resize_layer(ResizeLayerNode &node) // Create and configure function auto func = std::make_unique<ResizeLayerFunction>(); - func->configure(input, output, ScaleKernelInfo{ policy, BorderMode::CONSTANT, PixelValue(), SamplingPolicy::CENTER, false, false }); + func->configure(input, output, + ScaleKernelInfo{policy, BorderMode::CONSTANT, PixelValue(), SamplingPolicy::CENTER, false, false}); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " Interpolation: " << policy - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() + << " Interpolation: " << policy << std::endl); - return std::move(func); + return func; } /** Create a backend ROI align layer function @@ -1664,17 +1521,13 @@ std::unique_ptr<IFunction> create_roi_align_layer(ROIAlignLayerNode &node) func->configure(input, rois, output, pool_info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " ROIs shape: " << rois->info()->tensor_shape() - << " ROIPooling width: " << pool_info.pooled_width() - << " ROIPooling height: " << pool_info.pooled_height() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() + << " ROIs shape: " << rois->info()->tensor_shape() + << " ROIPooling width: " << pool_info.pooled_width() + << " ROIPooling height: " << pool_info.pooled_height() << std::endl); return std::move(func); } @@ -1704,16 +1557,12 @@ std::unique_ptr<IFunction> create_slice_layer(SliceLayerNode &node) func->configure(input, output, node.starts(), node.ends()); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend softmax layer function @@ -1743,16 +1592,12 @@ std::unique_ptr<IFunction> create_softmax_layer(SoftmaxLayerNode &node, GraphCon func->configure(input, output, beta); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } /** Create a backend layer stack function @@ -1767,12 +1612,13 @@ std::unique_ptr<IFunction> create_softmax_layer(SoftmaxLayerNode &node, GraphCon template <typename StackLayerFunction, typename TargetInfo> std::unique_ptr<arm_compute::IFunction> create_stack_layer(StackLayerNode &node) { - ARM_COMPUTE_LOG_GRAPH_VERBOSE("Creating Stack node with ID : " << node.id() << " and Name: " << node.name() << std::endl); + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Creating Stack node with ID : " << node.id() << " and Name: " << node.name() + << std::endl); ARM_COMPUTE_ERROR_ON(node.num_outputs() != 1); // Extract IO and info std::vector<typename TargetInfo::TensorType *> inputs; - for(unsigned int i = 0; i < node.num_inputs(); ++i) + for (unsigned int i = 0; i < node.num_inputs(); ++i) { inputs.push_back(get_backing_tensor<TargetInfo>(node.input(i))); } @@ -1784,18 +1630,14 @@ std::unique_ptr<arm_compute::IFunction> create_stack_layer(StackLayerNode &node) func->configure(inputs, axis, output); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << output->info()->data_type() - << " Inputs shape: " << inputs[0]->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << " Num Inputs: " << inputs.size() - << " Axis: " << axis - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() + << " Target: " << TargetInfo::TargetType + << " Data Type: " << output->info()->data_type() + << " Inputs shape: " << inputs[0]->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() + << " Num Inputs: " << inputs.size() << " Axis: " << axis << std::endl); - return std::move(func); + return func; } /** Create a backend slice layer function @@ -1828,20 +1670,16 @@ std::unique_ptr<IFunction> create_strided_slice_layer(StridedSliceLayerNode &nod func->configure(input, output, starts, ends, strides, info.begin_mask(), info.end_mask(), info.shrink_axis_mask()); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << node.type() - << " Target: " << TargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << " Input shape: " << input->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() << " Target: " + << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() + << " Input shape: " << input->info()->tensor_shape() + << " Output shape: " << output->info()->tensor_shape() << std::endl); - return std::move(func); + return func; } } // namespace detail } // namespace backends } // namespace graph } // namespace arm_compute -#endif /* ARM_COMPUTE_GRAPH_BACKENDS_DETAIL_FUNCTION_HELPERS_H */ +#endif // ACL_ARM_COMPUTE_GRAPH_BACKENDS_FUNCTIONHELPERS_H |