diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2018-04-05 17:20:34 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:49:37 +0000 |
commit | bb54e4e40b7b08c509e234cd91ebd3087af66c23 (patch) | |
tree | 5e0b6bdf58bb129ef2b3b26e6e65515bc8b76f83 /src/graph/backends/CL | |
parent | 4d33630096c769dd43716dd5607f151e3d5abef7 (diff) | |
download | ComputeLibrary-bb54e4e40b7b08c509e234cd91ebd3087af66c23.tar.gz |
COMPMID-797 Integrate Mobilenet QASYMM8 with new graph.
Change-Id: I4df63ec2f4eb27a8a6eec2bea27741bf8dec6910
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/126966
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/graph/backends/CL')
-rw-r--r-- | src/graph/backends/CL/CLDeviceBackend.cpp | 2 | ||||
-rw-r--r-- | src/graph/backends/CL/CLFunctionsFactory.cpp | 32 |
2 files changed, 25 insertions, 9 deletions
diff --git a/src/graph/backends/CL/CLDeviceBackend.cpp b/src/graph/backends/CL/CLDeviceBackend.cpp index f10eb33a98..92cb6936c3 100644 --- a/src/graph/backends/CL/CLDeviceBackend.cpp +++ b/src/graph/backends/CL/CLDeviceBackend.cpp @@ -126,7 +126,7 @@ std::unique_ptr<ITensorHandle> CLDeviceBackend::create_tensor(const Tensor &tens ARM_COMPUTE_ERROR_ON(tensor_desc.target != Target::CL); // Create backend tensor handle - TensorInfo info(tensor_desc.shape, 1, tensor_desc.data_type); + TensorInfo info(tensor_desc.shape, 1, tensor_desc.data_type, tensor_desc.quant_info); auto backend_tensor_handle = support::cpp14::make_unique<CLTensorHandle>(info); return std::move(backend_tensor_handle); diff --git a/src/graph/backends/CL/CLFunctionsFactory.cpp b/src/graph/backends/CL/CLFunctionsFactory.cpp index 1b448fefd2..ad73a797e3 100644 --- a/src/graph/backends/CL/CLFunctionsFactory.cpp +++ b/src/graph/backends/CL/CLFunctionsFactory.cpp @@ -154,10 +154,16 @@ std::unique_ptr<IFunction> create_convolution_layer(ConvolutionLayerNode &node, ARM_COMPUTE_ERROR_ON(node.num_outputs() != 1); // Extract IO and info - ICLTensor *input = get_backing_tensor(node.input(0)); - ICLTensor *weights = get_backing_tensor(node.input(1)); - ICLTensor *biases = get_backing_tensor(node.input(2)); - ICLTensor *output = get_backing_tensor(node.output(0)); + ICLTensor *input = get_backing_tensor(node.input(0)); + ICLTensor *weights = get_backing_tensor(node.input(1)); + ICLTensor *biases = get_backing_tensor(node.input(2)); + ICLTensor *output = get_backing_tensor(node.output(0)); + + if(is_data_type_quantized_asymmetric(input->info()->data_type())) + { + biases->info()->set_data_type(DataType::S32); + } + const PadStrideInfo conv_info = node.convolution_info(); const ConvolutionMethod conv_algorithm = node.convolution_method(); @@ -190,6 +196,8 @@ std::unique_ptr<IFunction> create_convolution_layer(ConvolutionLayerNode &node, // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << func_name << " Data Type: " << input->info()->data_type() + << " Input QuantInfo: " << input->info()->quantization_info() + << " Weights QuantInfo: " << weights->info()->quantization_info() << " Input shape: " << input->info()->tensor_shape() << " Weights shape: " << weights->info()->tensor_shape() << " Output shape: " << output->info()->tensor_shape() @@ -251,10 +259,16 @@ std::unique_ptr<IFunction> create_depthwise_convolution_layer(DepthwiseConvoluti ARM_COMPUTE_ERROR_ON(node.num_outputs() != 1); // Extract IO and info - ICLTensor *input = get_backing_tensor(node.input(0)); - ICLTensor *weights = get_backing_tensor(node.input(1)); - ICLTensor *biases = get_backing_tensor(node.input(2)); - ICLTensor *output = get_backing_tensor(node.output(0)); + ICLTensor *input = get_backing_tensor(node.input(0)); + ICLTensor *weights = get_backing_tensor(node.input(1)); + ICLTensor *biases = get_backing_tensor(node.input(2)); + ICLTensor *output = get_backing_tensor(node.output(0)); + + if(is_data_type_quantized_asymmetric(input->info()->data_type())) + { + biases->info()->set_data_type(DataType::S32); + } + const PadStrideInfo conv_info = node.convolution_info(); const DepthwiseConvolutionMethod dwc_algorithm = node.depthwise_convolution_method(); @@ -275,6 +289,8 @@ std::unique_ptr<IFunction> create_depthwise_convolution_layer(DepthwiseConvoluti // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " << func_name << " Data Type: " << input->info()->data_type() + << " Input QuantInfo: " << input->info()->quantization_info() + << " Weights QuantInfo: " << weights->info()->quantization_info() << " Input shape: " << input->info()->tensor_shape() << " Weights shape: " << weights->info()->tensor_shape() << " Output shape: " << output->info()->tensor_shape() |