aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Layer.cpp
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2019-02-05 16:00:08 +0000
committerDerek Lamberti <derek.lamberti@arm.com>2019-02-06 10:38:09 +0000
commit27d830720ed706f187f2a40e2c5055e424aa8b91 (patch)
tree7aac5ae83c79bf53e69f5951871f5cafd232d0a3 /src/armnn/Layer.cpp
parentf08876fce2b472a8c31f09d976fbcfeaaa94d228 (diff)
downloadarmnn-27d830720ed706f187f2a40e2c5055e424aa8b91.tar.gz
IVGCVSW-2606 Produce quantized InputNetwork from simple FP32 InputNetwork
Change-Id: I2140a7af5961ddf8267fbb127202de3900ea79e3 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'src/armnn/Layer.cpp')
-rw-r--r--src/armnn/Layer.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/armnn/Layer.cpp b/src/armnn/Layer.cpp
index 85e1de0b09..50b28adfc7 100644
--- a/src/armnn/Layer.cpp
+++ b/src/armnn/Layer.cpp
@@ -106,6 +106,35 @@ void OutputSlot::MoveAllConnections(OutputSlot& destination)
}
}
+unsigned int OutputSlot::CalculateIndexOnOwner() const
+{
+ for (unsigned int i=0; i < GetOwningLayer().GetNumOutputSlots(); i++)
+ {
+ if (GetOwningLayer().GetOutputSlot(i) == (*this))
+ {
+ return i;
+ }
+ }
+ BOOST_ASSERT_MSG(false, "Did not find slot on owner.");
+ return 0; // Error
+}
+
+bool OutputSlot::operator==(const OutputSlot& other) const
+{
+ bool isSame = other.GetNumConnections() == GetNumConnections();
+ if (!isSame)
+ {
+ return false;
+ }
+
+ for (unsigned int i=0; i < GetNumConnections(); i++)
+ {
+ isSame &= other.GetConnection(i) == GetConnection(i);
+ }
+ return isSame;
+}
+
+
void OutputSlot::ValidateConnectionIndex(unsigned int index) const
{
if (boost::numeric_cast<std::size_t>(index) >= m_Connections.size())