From 0ae5de9124a0094e656244ad2f807c084966fc04 Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Thu, 14 Mar 2019 10:32:11 +0000 Subject: COMPMID-1995: Prepare Graph to support different input/output quantization info - Added support for different input/output qinfo in ActivationLayer and DepthwiseConv - Added support for different input/output qinfo in ConcatenateLayer introducing ConcatDescriptor - Added reshape validate - Allow OutputLayer to return a specific connection index from the input - Not run Inplace and Depth mutator when input/output quantization info are different Change-Id: I03f5e416fc43ddd284e1501887202a3145f76d8a Signed-off-by: Isabella Gottardi Reviewed-on: https://review.mlplatform.org/c/852 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Georgios Pinitas --- arm_compute/graph/backends/FunctionHelpers.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'arm_compute/graph/backends/FunctionHelpers.h') diff --git a/arm_compute/graph/backends/FunctionHelpers.h b/arm_compute/graph/backends/FunctionHelpers.h index d0035d9a84..4a423d2490 100644 --- a/arm_compute/graph/backends/FunctionHelpers.h +++ b/arm_compute/graph/backends/FunctionHelpers.h @@ -109,7 +109,7 @@ std::unique_ptr create_activation_layer(ActivationLayerNode &node) ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() - << " Target " << TargetInfo::TargetType + << " Target: " << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() << " Shape: " << input->info()->tensor_shape() << " Activation function: " << act_info.activation() @@ -245,8 +245,10 @@ std::unique_ptr create_bounding_box_transform_layer(BoundingBoxTransf func->configure(input, output, deltas, bbox_info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.type() - << " Target " << TargetInfo::TargetType + 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() << " " @@ -326,6 +328,12 @@ std::unique_ptr create_concatenate_layer(ConcatenateLaye func->configure(inputs, output, concat_axis); // Log info + const bool is_quantized = is_data_type_quantized_asymmetric(output->info()->data_type()); + std::ostringstream qss; + if(is_quantized) + { + qss << " Output QuantInfo: " << output->info()->quantization_info(); + } ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.name() << " Type: " << node.type() @@ -334,6 +342,7 @@ std::unique_ptr create_concatenate_layer(ConcatenateLaye << " Shape: " << output->info()->tensor_shape() << " Num Inputs: " << inputs.size() << " Axis: " << concat_axis + << qss.str() << std::endl); return std::move(func); @@ -421,10 +430,10 @@ std::unique_ptr create_convolution_layer(ConvolutionLayerNode &node, << " Target: " << TargetInfo::TargetType << " Data Type: " << input->info()->data_type() << " Groups: " << num_groups - << qss.str() << " 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 func; @@ -536,11 +545,11 @@ std::unique_ptr create_depthwise_convolution_layer(DepthwiseConvoluti << " Type: " << func_name << " 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() << " Depth multiplier: " << depth_multiplier + << qss.str() << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") << std::endl); return func; @@ -1177,8 +1186,10 @@ std::unique_ptr create_roi_align_layer(ROIAlignLayerNode &node) func->configure(input, rois, output, pool_info); // Log info - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << node.type() - << " Target " << TargetInfo::TargetType + 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() -- cgit v1.2.1