aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Layer.cpp
diff options
context:
space:
mode:
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())