aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2022-05-24 11:34:02 +0100
committermike.kelly <mike.kelly@arm.com>2022-05-24 13:44:49 +0000
commit51b8c318c884106f03aa46fa6a130827b7bb3d02 (patch)
tree0c8caeac0decf71bee177dc9747a287b192016a3 /src
parent44f4fb590ac980e68b5bd7f78c41454c97378180 (diff)
downloadarmnn-51b8c318c884106f03aa46fa6a130827b7bb3d02.tar.gz
GitHub #644 Fixed build warnings
* Deserializer.cpp * Length() has been deprecated in flatbuffers v.1.12.0 or earlier. * SerializerTests.cpp * armnn::BaseDescriptor& descriptor is unused. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Icf0f09863f13dfd86c2c209c36c7f74f194c707b
Diffstat (limited to 'src')
-rw-r--r--src/armnnDeserializer/Deserializer.cpp28
-rw-r--r--src/armnnSerializer/test/SerializerTests.cpp2
2 files changed, 15 insertions, 15 deletions
diff --git a/src/armnnDeserializer/Deserializer.cpp b/src/armnnDeserializer/Deserializer.cpp
index 04dde73b20..90558bbd53 100644
--- a/src/armnnDeserializer/Deserializer.cpp
+++ b/src/armnnDeserializer/Deserializer.cpp
@@ -1272,14 +1272,14 @@ void IDeserializer::DeserializerImpl::ParseBatchToSpaceNd(GraphPtr graph, unsign
auto flatBufferCrops = flatBufferDescriptor->crops();
auto flatBufferBlockShape = flatBufferDescriptor->blockShape();
- if (flatBufferCrops->Length() % 2 != 0)
+ if (flatBufferCrops->size() % 2 != 0)
{
throw ParseException(fmt::format("The size of crops must be divisible by 2 {}", CHECK_LOCATION().AsString()));
}
std::vector<std::pair<unsigned int, unsigned int>> crops;
- crops.reserve(flatBufferCrops->Length() / 2);
- for (unsigned int i = 0; i < flatBufferCrops->Length() - 1; i += 2)
+ crops.reserve(flatBufferCrops->size() / 2);
+ for (unsigned int i = 0; i < flatBufferCrops->size() - 1; i += 2)
{
crops.emplace_back(flatBufferCrops->Get(i), flatBufferCrops->Get(i+1));
}
@@ -2179,15 +2179,15 @@ void IDeserializer::DeserializerImpl::ParsePad(GraphPtr graph, unsigned int laye
auto paddingMode = flatBufferDescriptor->paddingMode();
float padValue = flatBufferDescriptor->padValue();
- if (flatBufferPadList->Length() % 2 != 0)
+ if (flatBufferPadList->size() % 2 != 0)
{
throw ParseException(fmt::format("The size of the pad list must be divisible by 2 {}",
CHECK_LOCATION().AsString()));
}
std::vector<std::pair<unsigned int, unsigned int>> padList;
- padList.reserve(flatBufferPadList->Length() / 2);
- for (unsigned int i = 0; i < flatBufferPadList->Length() - 1; i += 2)
+ padList.reserve(flatBufferPadList->size() / 2);
+ for (unsigned int i = 0; i < flatBufferPadList->size() - 1; i += 2)
{
padList.emplace_back(flatBufferPadList->Get(i), flatBufferPadList->Get(i+1));
}
@@ -2219,7 +2219,7 @@ void IDeserializer::DeserializerImpl::ParsePermute(GraphPtr graph, unsigned int
auto outputInfo = ToTensorInfo(outputs[0]);
auto layerName = GetLayerName(graph, layerIndex);
- const armnn::PermuteDescriptor descriptor(armnn::PermutationVector(dimsMapping->data(), dimsMapping->Length()));
+ const armnn::PermuteDescriptor descriptor(armnn::PermutationVector(dimsMapping->data(), dimsMapping->size()));
IConnectableLayer* layer = m_Network->AddPermuteLayer(descriptor, layerName.c_str());
layer->GetOutputSlot(0).SetTensorInfo(outputInfo);
@@ -2727,15 +2727,15 @@ void IDeserializer::DeserializerImpl::ParseSpaceToBatchNd(GraphPtr graph, unsign
auto flatBufferPadList = flatBufferDescriptor->padList();
auto flatBufferBlockShape = flatBufferDescriptor->blockShape();
- if (flatBufferPadList->Length() % 2 != 0)
+ if (flatBufferPadList->size() % 2 != 0)
{
throw ParseException(fmt::format("The size of the pad list must be divisible by 2 {}",
CHECK_LOCATION().AsString()));
}
std::vector<std::pair<unsigned int, unsigned int>> padList;
- padList.reserve(flatBufferPadList->Length() / 2);
- for (unsigned int i = 0; i < flatBufferPadList->Length() - 1; i += 2)
+ padList.reserve(flatBufferPadList->size() / 2);
+ for (unsigned int i = 0; i < flatBufferPadList->size() - 1; i += 2)
{
padList.emplace_back(flatBufferPadList->Get(i), flatBufferPadList->Get(i+1));
}
@@ -2911,7 +2911,7 @@ void IDeserializer::DeserializerImpl::ParseSlice(GraphPtr graph, unsigned int la
auto fbBegin = fbDescriptor->begin();
auto fbSize = fbDescriptor->size();
- if (fbBegin->Length() != fbSize->Length())
+ if (fbBegin->size() != fbSize->size())
{
throw ParseException(fmt::format("Begin and size descriptors must have the same length {}",
CHECK_LOCATION().AsString()));
@@ -2947,8 +2947,8 @@ void IDeserializer::DeserializerImpl::ParseStridedSlice(GraphPtr graph, unsigned
auto flatBufferEnd = flatBufferDescriptor->end();
auto flatBufferStride = flatBufferDescriptor->stride();
- if (!(flatBufferBegin->Length() == flatBufferEnd->Length() &&
- flatBufferBegin->Length() == flatBufferStride->Length()))
+ if (!(flatBufferBegin->size() == flatBufferEnd->size() &&
+ flatBufferBegin->size() == flatBufferStride->size()))
{
throw ParseException(fmt::format("The size of the begin, end, and stride must be equal {}",
CHECK_LOCATION().AsString()));
@@ -3542,7 +3542,7 @@ void IDeserializer::DeserializerImpl::ParseTranspose(GraphPtr graph, unsigned in
auto outputInfo = ToTensorInfo(outputs[0]);
auto layerName = GetLayerName(graph, layerIndex);
- const armnn::TransposeDescriptor descriptor(armnn::PermutationVector(dimsMapping->data(), dimsMapping->Length()));
+ const armnn::TransposeDescriptor descriptor(armnn::PermutationVector(dimsMapping->data(), dimsMapping->size()));
IConnectableLayer* layer = m_Network->AddTransposeLayer(descriptor, layerName.c_str());
layer->GetOutputSlot(0).SetTensorInfo(outputInfo);
diff --git a/src/armnnSerializer/test/SerializerTests.cpp b/src/armnnSerializer/test/SerializerTests.cpp
index 43a8aae9a7..3c00fc43ae 100644
--- a/src/armnnSerializer/test/SerializerTests.cpp
+++ b/src/armnnSerializer/test/SerializerTests.cpp
@@ -1274,7 +1274,7 @@ TEST_CASE("SerializeGatherNd")
: LayerVerifierBase(layerName, inputInfos, outputInfos) {}
void ExecuteStrategy(const armnn::IConnectableLayer* layer,
- const armnn::BaseDescriptor& descriptor,
+ const armnn::BaseDescriptor&,
const std::vector<armnn::ConstTensor>& constants,
const char* name,
const armnn::LayerBindingId id = 0) override