diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-11-23 15:59:55 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:41:58 +0000 |
commit | 236bfe7033a313ab98ff436d85f38a58b0738ed1 (patch) | |
tree | a07d0b122fa93fb26a24067de6341eaded1a52f7 /src/graph/nodes | |
parent | 9c450cc0e0b2e7060fa0a74a5196906bc28d0625 (diff) | |
download | ComputeLibrary-236bfe7033a313ab98ff436d85f38a58b0738ed1.tar.gz |
COMPIMID-553: MobileNet use case.
Change-Id: I1181abbd5785065f3d57e91844376a4b110938a9
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110701
Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/graph/nodes')
-rw-r--r-- | src/graph/nodes/ConvolutionLayer.cpp | 9 | ||||
-rw-r--r-- | src/graph/nodes/DepthwiseConvolutionLayer.cpp | 7 | ||||
-rw-r--r-- | src/graph/nodes/ReshapeLayer.cpp | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/graph/nodes/ConvolutionLayer.cpp b/src/graph/nodes/ConvolutionLayer.cpp index a7236fc78a..ae4a8d7e6b 100644 --- a/src/graph/nodes/ConvolutionLayer.cpp +++ b/src/graph/nodes/ConvolutionLayer.cpp @@ -189,7 +189,7 @@ std::unique_ptr<arm_compute::IFunction> ConvolutionLayer::instantiate_node(Graph in->info()->data_type(), in->info()->fixed_point_position())); } - if(_biases.tensor() == nullptr) + if(_biases.has_accessor() && _biases.tensor() == nullptr) { _biases.set_info(TensorInfo(TensorShape(_ofm), in->info()->num_channels(), in->info()->data_type(), in->info()->fixed_point_position())); } @@ -200,11 +200,14 @@ std::unique_ptr<arm_compute::IFunction> ConvolutionLayer::instantiate_node(Graph // Check if the weights and biases are loaded bool weights_are_loaded = _weights.tensor() != nullptr; - bool biases_are_loaded = _weights.tensor() != nullptr; + bool biases_are_loaded = _biases.has_accessor() ? _biases.tensor() != nullptr : true; // Set bias and weights target _weights.set_target(_target_hint); - _biases.set_target(_target_hint); + if(_biases.has_accessor()) + { + _biases.set_target(_target_hint); + } // Calculate output shape TensorShape output_shape = calculate_convolution_layer_output_shape(in->info()->tensor_shape(), _weights.info().tensor_shape(), _conv_info); diff --git a/src/graph/nodes/DepthwiseConvolutionLayer.cpp b/src/graph/nodes/DepthwiseConvolutionLayer.cpp index 1c006d61db..ceac2a2def 100644 --- a/src/graph/nodes/DepthwiseConvolutionLayer.cpp +++ b/src/graph/nodes/DepthwiseConvolutionLayer.cpp @@ -51,10 +51,13 @@ std::unique_ptr<arm_compute::IFunction> DepthwiseConvolutionLayer::instantiate_n } bool weights_is_loaded = _weights.tensor() != nullptr; - bool biases_is_loaded = _biases.has_accessor() ? _biases.tensor() != nullptr : false; + bool biases_is_loaded = _biases.has_accessor() ? _biases.tensor() != nullptr : true; _weights.set_target(_target_hint); - _biases.set_target(_target_hint); + if(_biases.has_accessor()) + { + _biases.set_target(_target_hint); + } // Create node context NodeContext node_ctx(OperationType::DepthwiseConvolutionLayer); diff --git a/src/graph/nodes/ReshapeLayer.cpp b/src/graph/nodes/ReshapeLayer.cpp index 4967534879..bbe0739e64 100644 --- a/src/graph/nodes/ReshapeLayer.cpp +++ b/src/graph/nodes/ReshapeLayer.cpp @@ -47,11 +47,11 @@ std::unique_ptr<arm_compute::IFunction> ReshapeLayer::instantiate_node(GraphCont arm_compute::auto_init_if_empty(*out->info(), _shape, 1, in->info()->data_type(), in->info()->fixed_point_position()); // Create node context - NodeContext node_ctx(OperationType::QuantizationLayer); + NodeContext node_ctx(OperationType::ReshapeLayer); node_ctx.set_target(_target_hint); node_ctx.add_input(in); node_ctx.add_output(out); // Get function - return OperationRegistry::get().find_operation(OperationType::QuantizationLayer, _target_hint)->configure(node_ctx); + return OperationRegistry::get().find_operation(OperationType::ReshapeLayer, _target_hint)->configure(node_ctx); } |