diff options
author | Derek Lamberti <derek.lamberti@arm.com> | 2019-02-05 16:00:08 +0000 |
---|---|---|
committer | Derek Lamberti <derek.lamberti@arm.com> | 2019-02-06 10:38:09 +0000 |
commit | 27d830720ed706f187f2a40e2c5055e424aa8b91 (patch) | |
tree | 7aac5ae83c79bf53e69f5951871f5cafd232d0a3 /src/armnn/Layer.cpp | |
parent | f08876fce2b472a8c31f09d976fbcfeaaa94d228 (diff) | |
download | armnn-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.cpp | 29 |
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()) |