diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2022-12-21 09:10:04 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2023-01-12 11:11:28 +0000 |
commit | 01f72693d39ed966ad06adadc8aac141bc395659 (patch) | |
tree | d619d2c112bff714d38025b57370aa4095935e36 /include/armnn/backends | |
parent | 05b6a3e5946a3f58b6f5b0caface9153a1c2b364 (diff) | |
download | armnn-01f72693d39ed966ad06adadc8aac141bc395659.tar.gz |
IVGCVSW-7418 Allow working copy SubgraphView to get Original Slots
* API to remove need for workaround so backend users can get slots
* OutputSlots outside the SubgraphView needed to obtain TensorInfo
* Fix a few Copyright headers
* Add shared_ptr back to original subgraph view using
std::enable_shared_from_this
Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Change-Id: I033a00d6fc4020619d406ac06a156b7e380a426a
Diffstat (limited to 'include/armnn/backends')
-rw-r--r-- | include/armnn/backends/SubgraphView.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/armnn/backends/SubgraphView.hpp b/include/armnn/backends/SubgraphView.hpp index 777311747a..24f8958930 100644 --- a/include/armnn/backends/SubgraphView.hpp +++ b/include/armnn/backends/SubgraphView.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017, 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -28,7 +28,7 @@ class OutputSlot; /// the contents of the SubgraphView become invalid when the Layers are destroyed /// or changed. /// -class SubgraphView final +class SubgraphView final : public std::enable_shared_from_this<SubgraphView> { public: template <typename Func> @@ -53,7 +53,7 @@ public: } } - using SubgraphViewPtr = std::unique_ptr<SubgraphView>; + using SubgraphViewPtr = std::shared_ptr<SubgraphView>; using InputSlots = std::vector<InputSlot*>; using IInputSlots = std::vector<IInputSlot*>; using OutputSlots = std::vector<OutputSlot*>; @@ -171,6 +171,13 @@ public: void SubstituteSubgraph(SubgraphView&, IConnectableLayer*); void SubstituteSubgraph(SubgraphView&, const SubgraphView&); + /// These methods should be called on a working copy subgraph created from GetWorkingCopy. + /// They return pointers to the input and output Slots belonging to the original SubgraphView + /// that the working copy was created from. + /// This may be used to find the original TensorInfo of connected boundary OutputSlots. + const IInputSlots& GetOriginalInputSlots() const; + const IOutputSlots& GetOriginalOutputSlots() const; + private: struct SubgraphViewWorkingCopy; |