aboutsummaryrefslogtreecommitdiff
path: root/src/graph
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-11-23 15:59:55 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:41:58 +0000
commit236bfe7033a313ab98ff436d85f38a58b0738ed1 (patch)
treea07d0b122fa93fb26a24067de6341eaded1a52f7 /src/graph
parent9c450cc0e0b2e7060fa0a74a5196906bc28d0625 (diff)
downloadComputeLibrary-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')
-rw-r--r--src/graph/nodes/ConvolutionLayer.cpp9
-rw-r--r--src/graph/nodes/DepthwiseConvolutionLayer.cpp7
-rw-r--r--src/graph/nodes/ReshapeLayer.cpp4
-rw-r--r--src/graph/operations/CLSimpleOperations.cpp2
-rw-r--r--src/graph/operations/NESimpleOperations.cpp2
5 files changed, 15 insertions, 9 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);
}
diff --git a/src/graph/operations/CLSimpleOperations.cpp b/src/graph/operations/CLSimpleOperations.cpp
index 881f4910ad..647f88f0e2 100644
--- a/src/graph/operations/CLSimpleOperations.cpp
+++ b/src/graph/operations/CLSimpleOperations.cpp
@@ -138,7 +138,7 @@ REGISTER_SIMPLE_OPERATION(CLDepthConvertLayerOperation, OPENCL, OperationType::D
/* DepthwiseConvolutionLayer Layer */
REGISTER_SIMPLE_OPERATION(CLDepthwiseConvolutionOperation, OPENCL, OperationType::DepthwiseConvolutionLayer)
{
- ARM_COMPUTE_ERROR_ON(ctx.num_inputs() != 2 || ctx.num_inputs() != 3);
+ ARM_COMPUTE_ERROR_ON(ctx.num_inputs() != 2 && ctx.num_inputs() != 3);
ARM_COMPUTE_ERROR_ON(ctx.num_outputs() != 1);
ARM_COMPUTE_ERROR_ON(dynamic_cast<arm_compute::ICLTensor *>(ctx.input(0)) == nullptr);
ARM_COMPUTE_ERROR_ON(dynamic_cast<arm_compute::ICLTensor *>(ctx.output(0)) == nullptr);
diff --git a/src/graph/operations/NESimpleOperations.cpp b/src/graph/operations/NESimpleOperations.cpp
index c77aeeca11..f234341cec 100644
--- a/src/graph/operations/NESimpleOperations.cpp
+++ b/src/graph/operations/NESimpleOperations.cpp
@@ -138,7 +138,7 @@ REGISTER_SIMPLE_OPERATION(NEDepthConvertLayerOperation, NEON, OperationType::Dep
/* DepthwiseConvolutionLayer Layer */
REGISTER_SIMPLE_OPERATION(NEDepthwiseConvolutionOperation, NEON, OperationType::DepthwiseConvolutionLayer)
{
- ARM_COMPUTE_ERROR_ON(ctx.num_inputs() != 2 || ctx.num_inputs() != 3);
+ ARM_COMPUTE_ERROR_ON(ctx.num_inputs() != 2 && ctx.num_inputs() != 3);
ARM_COMPUTE_ERROR_ON(ctx.num_outputs() != 1);
ARM_COMPUTE_ERROR_ON(dynamic_cast<arm_compute::ITensor *>(ctx.input(0)) == nullptr);
ARM_COMPUTE_ERROR_ON(dynamic_cast<arm_compute::ITensor *>(ctx.output(0)) == nullptr);