From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/classarmnn_1_1_output_slot.xhtml | 1105 ++++++++++++++++++++++++++++++++ 1 file changed, 1105 insertions(+) create mode 100644 20.02/classarmnn_1_1_output_slot.xhtml (limited to '20.02/classarmnn_1_1_output_slot.xhtml') diff --git a/20.02/classarmnn_1_1_output_slot.xhtml b/20.02/classarmnn_1_1_output_slot.xhtml new file mode 100644 index 0000000000..1724d90357 --- /dev/null +++ b/20.02/classarmnn_1_1_output_slot.xhtml @@ -0,0 +1,1105 @@ + + + + + + + + + + + + + +ArmNN: OutputSlot Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
OutputSlot Class Referencefinal
+
+
+ +

#include <Layer.hpp>

+
+Inheritance diagram for OutputSlot:
+
+
+ + +IOutputSlot + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 OutputSlot (Layer &owner, OutputHandler &outputHandler)
 
 OutputSlot (const OutputSlot &)=delete
 
OutputSlotoperator= (const OutputSlot &)=delete
 
OutputSlotoperator= (OutputSlot &&)=delete
 
 OutputSlot (OutputSlot &&)=default
 
 ~OutputSlot ()
 
LayerGetOwningLayer () const
 
LayerGuid GetOwningLayerGuid () const override
 
const OutputHandlerGetOutputHandler () const
 
OutputHandlerGetOutputHandler ()
 
int Connect (InputSlot &destination)
 
void Disconnect (InputSlot &slot)
 
const std::vector< InputSlot * > & GetConnections () const
 
const std::vector< EdgeStrategy > & GetEdgeStrategies () const
 
bool ValidateTensorShape (const TensorShape &shape) const
 
void DisconnectAll ()
 
void MoveAllConnections (OutputSlot &destination)
 Moves all connections to another OutputSlot. More...
 
unsigned int GetNumConnections () const override
 
const InputSlotGetConnection (unsigned int index) const override
 
InputSlotGetConnection (unsigned int index) override
 
void SetTensorInfo (const TensorInfo &tensorInfo) override
 
const TensorInfoGetTensorInfo () const override
 
bool IsTensorInfoSet () const override
 
int Connect (IInputSlot &destination) override
 
void Disconnect (IInputSlot &slot) override
 
unsigned int CalculateIndexOnOwner () const override
 
bool operator== (const OutputSlot &other) const
 
void SetTensorHandleFactory (const ITensorHandleFactory::FactoryId &id)
 
ITensorHandleFactory::FactoryId GetTensorHandleFactoryId () const
 
void SetEdgeStrategy (unsigned int connectionIndex, EdgeStrategy strategy)
 
EdgeStrategy GetEdgeStrategyForConnection (unsigned int connectionIdx) const
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from IOutputSlot
 ~IOutputSlot ()
 Not user deletable. More...
 
+

Detailed Description

+
+

Definition at line 83 of file Layer.hpp.

+

Constructor & Destructor Documentation

+ +

◆ OutputSlot() [1/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
OutputSlot (Layerowner,
OutputHandleroutputHandler 
)
+
+inlineexplicit
+
+ +

Definition at line 86 of file Layer.hpp.

+
87  : m_OwningLayer(owner)
88  , m_OutputHandler(outputHandler)
89  , m_TensorHandleFactoryId(ITensorHandleFactory::LegacyFactoryId)
90  {}
static const FactoryId LegacyFactoryId
+
+
+
+ +

◆ OutputSlot() [2/3]

+ +
+
+ + + + + +
+ + + + + + + + +
OutputSlot (const OutputSlot)
+
+delete
+
+ +
+
+ +

◆ OutputSlot() [3/3]

+ +
+
+ + + + + +
+ + + + + + + + +
OutputSlot (OutputSlot && )
+
+default
+
+ +
+
+ +

◆ ~OutputSlot()

+ +
+
+ + + + + +
+ + + + + + + +
~OutputSlot ()
+
+inline
+
+ +

Definition at line 98 of file Layer.hpp.

+
99  {
100  try
101  {
102  // Coverity fix: DisconnectAll() may throw uncaught exceptions.
103  DisconnectAll();
104  }
105  catch (const std::exception& e)
106  {
107  // Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
108  // exception of type std::length_error.
109  // Using stderr instead in this context as there is no point in nesting try-catch blocks here.
110  std::cerr << "WARNING: An error has occurred when disconnecting all output slots: "
111  << e.what() << std::endl;
112  }
113  }
void DisconnectAll()
Definition: Layer.cpp:103
+
+
+
+

Member Function Documentation

+ +

◆ CalculateIndexOnOwner()

+ +
+
+ + + + + +
+ + + + + + + +
unsigned int CalculateIndexOnOwner () const
+
+overridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 125 of file Layer.cpp.

+ +

References Layer::GetNumOutputSlots(), Layer::GetOutputSlot(), and InputSlot::GetOwningLayer().

+ +

Referenced by DebugLayer::CreateWorkload(), and QuantizerVisitor::QuantizerVisitor().

+
126 {
127  for (unsigned int i = 0; i < GetOwningLayer().GetNumOutputSlots(); i++)
128  {
129  if (GetOwningLayer().GetOutputSlot(i) == (*this))
130  {
131  return i;
132  }
133  }
134  BOOST_ASSERT_MSG(false, "Did not find slot on owner.");
135  return 0; // Error
136 }
Layer & GetOwningLayer() const
Definition: Layer.hpp:115
+
unsigned int GetNumOutputSlots() const override
Returns the number of connectable output slots.
Definition: Layer.hpp:308
+
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
Definition: Layer.hpp:312
+
+
+
+ +

◆ Connect() [1/2]

+ +
+
+ + + + + + + + +
int Connect (InputSlotdestination)
+
+ +

Definition at line 79 of file Layer.cpp.

+ +

References armnn::numeric_cast(), InputSlot::SetConnection(), and armnn::Undefined.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CreateConvolution2dGraph(), CreateDepthwiseConvolution2dGraph(), CreateGatherGraph(), CreatePooling2dGraph(), CreateResizeBilinearGraph(), DynamicQuantizationVisitor::FinishVisit(), InputSlot::Insert(), Graph::InsertNewLayer(), and OutputSlot::MoveAllConnections().

+
80 {
81  destination.SetConnection(this);
82  m_Connections.push_back(&destination);
83  m_EdgeStrategies.push_back(EdgeStrategy::Undefined);
84  return boost::numeric_cast<int>(m_Connections.size() - 1);
85 }
+
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:33
+
+
+
+ +

◆ Connect() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
int Connect (IInputSlotdestination)
+
+inlineoverridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 146 of file Layer.hpp.

+ +

References Connect().

+
147  {
148  return Connect(*boost::polymorphic_downcast<InputSlot*>(&destination));
149  }
int Connect(InputSlot &destination)
Definition: Layer.cpp:79
+
+
+
+ +

◆ Disconnect() [1/2]

+ +
+
+ + + + + + + + +
void Disconnect (InputSlotslot)
+
+ +

Definition at line 87 of file Layer.cpp.

+ +

References InputSlot::SetConnection().

+ +

Referenced by DynamicQuantizationVisitor::FinishVisit().

+
88 {
89  slot.SetConnection(nullptr);
90  auto it = std::find(m_Connections.begin(), m_Connections.end(), &slot);
91 
92  if (it == m_Connections.end())
93  {
94  return;
95  }
96 
97  auto idx = std::distance(m_Connections.begin(), it);
98  m_Connections.erase(std::remove(m_Connections.begin(), m_Connections.end(), &slot), m_Connections.end());
99 
100  m_EdgeStrategies.erase(m_EdgeStrategies.begin() + idx);
101 }
+
+
+ +

◆ Disconnect() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
void Disconnect (IInputSlotslot)
+
+inlineoverridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 151 of file Layer.hpp.

+ +

References armnnUtils::operator==().

+
152  {
153  return Disconnect(*boost::polymorphic_downcast<InputSlot*>(&slot));
154  }
void Disconnect(InputSlot &slot)
Definition: Layer.cpp:87
+
+
+
+ +

◆ DisconnectAll()

+ +
+
+ + + + + + + +
void DisconnectAll ()
+
+ +

Definition at line 103 of file Layer.cpp.

+ +

References InputSlot::GetConnection().

+
104 {
105  while (GetNumConnections() > 0)
106  {
107  InputSlot& connection = *GetConnection(0);
108  Disconnect(connection);
109  }
110 }
void Disconnect(InputSlot &slot)
Definition: Layer.cpp:87
+
unsigned int GetNumConnections() const override
Definition: Layer.hpp:138
+
const InputSlot * GetConnection(unsigned int index) const override
Definition: Layer.cpp:46
+
+
+
+ +

◆ GetConnection() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
const InputSlot * GetConnection (unsigned int index) const
+
+overridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 46 of file Layer.cpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), and OutputSlot::operator==().

+
47 {
48  ValidateConnectionIndex(index);
49  return m_Connections[index];
50 }
+
+
+ +

◆ GetConnection() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
InputSlot * GetConnection (unsigned int index)
+
+overridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 52 of file Layer.cpp.

+
53 {
54  ValidateConnectionIndex(index);
55  return m_Connections[index];
56 }
+
+
+ +

◆ GetConnections()

+ +
+
+ + + + + +
+ + + + + + + +
const std::vector<InputSlot*>& GetConnections () const
+
+inline
+
+
+ +

◆ GetEdgeStrategies()

+ +
+
+ + + + + +
+ + + + + + + +
const std::vector<EdgeStrategy>& GetEdgeStrategies () const
+
+inline
+
+ +

Definition at line 126 of file Layer.hpp.

+ +

Referenced by Graph::AddCompatibilityLayers().

+
126 { return m_EdgeStrategies; }
+
+
+ +

◆ GetEdgeStrategyForConnection()

+ +
+
+ + + + + + + + +
EdgeStrategy GetEdgeStrategyForConnection (unsigned int connectionIdx) const
+
+ +

Definition at line 182 of file Layer.cpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE().

+
183 {
184  return m_EdgeStrategies[connectionIdx];
185 }
+
+
+ +

◆ GetNumConnections()

+ +
+
+ + + + + +
+ + + + + + + +
unsigned int GetNumConnections () const
+
+inlineoverridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 138 of file Layer.hpp.

+ +

References InputSlot::GetConnection(), armnn::GetTensorInfo(), and armnn::numeric_cast().

+ +

Referenced by ConcatLayer::CreateWorkload(), OutputSlot::operator==(), OptimizeConsecutiveReshapesImpl::Run(), MoveTransposeUpImpl::Run(), MovePermuteUpImpl::Run(), and SquashEqualSiblingsImpl< Comparable >::Run().

+
138 { return boost::numeric_cast<unsigned int>(m_Connections.size()); }
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:33
+
+
+
+ +

◆ GetOutputHandler() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
const OutputHandler& GetOutputHandler () const
+
+inline
+
+ +

Definition at line 119 of file Layer.hpp.

+ +

Referenced by ConcatLayer::CreateWorkload().

+
119 { return m_OutputHandler; }
+
+
+ +

◆ GetOutputHandler() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
OutputHandler& GetOutputHandler ()
+
+inline
+
+ +

Definition at line 120 of file Layer.hpp.

+ +

References Connect().

+
120 { return m_OutputHandler; }
+
+
+ +

◆ GetOwningLayer()

+ + + +

◆ GetOwningLayerGuid()

+ +
+
+ + + + + +
+ + + + + + + +
LayerGuid GetOwningLayerGuid () const
+
+overridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 162 of file Layer.cpp.

+ +

References Layer::GetGuid(), and InputSlot::GetOwningLayer().

+
163 {
164  return GetOwningLayer().GetGuid();
165 }
Layer & GetOwningLayer() const
Definition: Layer.hpp:115
+
LayerGuid GetGuid() const final
Returns the unique id of the layer.
Definition: Layer.hpp:316
+
+
+
+ +

◆ GetTensorHandleFactoryId()

+ +
+
+ + + + + + + +
ITensorHandleFactory::FactoryId GetTensorHandleFactoryId () const
+
+
+ +

◆ GetTensorInfo()

+ +
+
+ + + + + +
+ + + + + + + +
const TensorInfo & GetTensorInfo () const
+
+overridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 63 of file Layer.cpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), armnn::CheckScaleSetOnQuantizedType(), ConcatLayer::CreateWorkload(), Layer::GetDataType(), armnn::InsertConvertFp16ToFp32LayersBefore(), armnn::InsertConvertFp32ToFp16LayersAfter(), armnn::InsertDebugLayerAfter(), IWorkloadFactory::IsLayerSupported(), QuantizerVisitor::QuantizerVisitor(), PermuteAndBatchToSpaceAsDepthToSpaceImpl< PermuteType >::Run(), Graph::SerializeToDot(), ElementwiseBaseLayer::ValidateTensorShapesFromInputs(), QuantizeLayer::ValidateTensorShapesFromInputs(), ActivationLayer::ValidateTensorShapesFromInputs(), TransposeLayer::ValidateTensorShapesFromInputs(), DequantizeLayer::ValidateTensorShapesFromInputs(), MergeLayer::ValidateTensorShapesFromInputs(), SoftmaxLayer::ValidateTensorShapesFromInputs(), NormalizationLayer::ValidateTensorShapesFromInputs(), PermuteLayer::ValidateTensorShapesFromInputs(), Pooling2dLayer::ValidateTensorShapesFromInputs(), DebugLayer::ValidateTensorShapesFromInputs(), ReshapeLayer::ValidateTensorShapesFromInputs(), FakeQuantizationLayer::ValidateTensorShapesFromInputs(), ResizeLayer::ValidateTensorShapesFromInputs(), RsqrtLayer::ValidateTensorShapesFromInputs(), SliceLayer::ValidateTensorShapesFromInputs(), FloorLayer::ValidateTensorShapesFromInputs(), StackLayer::ValidateTensorShapesFromInputs(), MemImportLayer::ValidateTensorShapesFromInputs(), ConvertFp32ToFp16Layer::ValidateTensorShapesFromInputs(), SwitchLayer::ValidateTensorShapesFromInputs(), InstanceNormalizationLayer::ValidateTensorShapesFromInputs(), AbsLayer::ValidateTensorShapesFromInputs(), L2NormalizationLayer::ValidateTensorShapesFromInputs(), BatchToSpaceNdLayer::ValidateTensorShapesFromInputs(), MemCopyLayer::ValidateTensorShapesFromInputs(), ConvertFp16ToFp32Layer::ValidateTensorShapesFromInputs(), GatherLayer::ValidateTensorShapesFromInputs(), LogSoftmaxLayer::ValidateTensorShapesFromInputs(), MeanLayer::ValidateTensorShapesFromInputs(), ConstantLayer::ValidateTensorShapesFromInputs(), DetectionPostProcessLayer::ValidateTensorShapesFromInputs(), ElementwiseUnaryLayer::ValidateTensorShapesFromInputs(), ArgMinMaxLayer::ValidateTensorShapesFromInputs(), StridedSliceLayer::ValidateTensorShapesFromInputs(), FullyConnectedLayer::ValidateTensorShapesFromInputs(), DepthwiseConvolution2dLayer::ValidateTensorShapesFromInputs(), SpaceToBatchNdLayer::ValidateTensorShapesFromInputs(), ComparisonLayer::ValidateTensorShapesFromInputs(), SpaceToDepthLayer::ValidateTensorShapesFromInputs(), PreluLayer::ValidateTensorShapesFromInputs(), TransposeConvolution2dLayer::ValidateTensorShapesFromInputs(), DepthToSpaceLayer::ValidateTensorShapesFromInputs(), Convolution2dLayer::ValidateTensorShapesFromInputs(), SplitterLayer::ValidateTensorShapesFromInputs(), BatchNormalizationLayer::ValidateTensorShapesFromInputs(), QuantizedLstmLayer::ValidateTensorShapesFromInputs(), and LstmLayer::ValidateTensorShapesFromInputs().

+
64 {
66 }
const OutputHandler & GetOutputHandler() const
Definition: Layer.hpp:119
+
const TensorInfo & GetTensorInfo() const
Gets the matching TensorInfo for the output.
+
+
+
+ +

◆ IsTensorInfoSet()

+ +
+
+ + + + + +
+ + + + + + + +
bool IsTensorInfoSet () const
+
+overridevirtual
+
+ +

Implements IOutputSlot.

+ +

Definition at line 68 of file Layer.cpp.

+ +

Referenced by InputLayer::ValidateTensorShapesFromInputs().

+
69 {
71 }
bool IsTensorInfoSet() const
Returns true if SetTensorInfo() has been called at least once on this.
+
const OutputHandler & GetOutputHandler() const
Definition: Layer.hpp:119
+
+
+
+ +

◆ MoveAllConnections()

+ +
+
+ + + + + + + + +
void MoveAllConnections (OutputSlotdestination)
+
+ +

Moves all connections to another OutputSlot.

+ +

Definition at line 112 of file Layer.cpp.

+ +

References OutputSlot::Connect(), InputSlot::GetConnection(), and armnn::Undefined.

+ +

Referenced by Graph::InsertNewLayer(), TransposeAsReshapeImpl::Run(), PermuteAsReshapeImpl::Run(), OptimizeConsecutiveReshapesImpl::Run(), FoldPadIntoConvolution2dImpl::Run(), OptimizeInverseConversionsImpl::Run(), OptimizeInversePermutesImpl< PermuteType >::Run(), and Graph::SubstituteSubgraph().

+
113 {
114  while (GetNumConnections() > 0)
115  {
116  BOOST_ASSERT_MSG(m_EdgeStrategies[0] == EdgeStrategy::Undefined,
117  "Cannot move connections once memory strategies have be established.");
118 
119  InputSlot& connection = *GetConnection(0);
120  Disconnect(connection);
121  destination.Connect(connection);
122  }
123 }
void Disconnect(InputSlot &slot)
Definition: Layer.cpp:87
+
unsigned int GetNumConnections() const override
Definition: Layer.hpp:138
+ +
const InputSlot * GetConnection(unsigned int index) const override
Definition: Layer.cpp:46
+
+
+
+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
OutputSlot& operator= (const OutputSlot)
+
+delete
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
OutputSlot& operator= (OutputSlot && )
+
+delete
+
+ +
+
+ +

◆ operator==()

+ +
+
+ + + + + + + + +
bool operator== (const OutputSlotother) const
+
+ +

Definition at line 138 of file Layer.cpp.

+ +

References InputSlot::GetConnection(), OutputSlot::GetConnection(), and OutputSlot::GetNumConnections().

+
139 {
140  bool isSame = other.GetNumConnections() == GetNumConnections();
141  if (!isSame)
142  {
143  return false;
144  }
145 
146  for (unsigned int i = 0; i < GetNumConnections(); i++)
147  {
148  isSame &= other.GetConnection(i) == GetConnection(i);
149  }
150  return isSame;
151 }
unsigned int GetNumConnections() const override
Definition: Layer.hpp:138
+
const InputSlot * GetConnection(unsigned int index) const override
Definition: Layer.cpp:46
+
+
+
+ +

◆ SetEdgeStrategy()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void SetEdgeStrategy (unsigned int connectionIndex,
EdgeStrategy strategy 
)
+
+ +

Definition at line 177 of file Layer.cpp.

+ +

Referenced by Graph::AddCompatibilityLayers(), BOOST_FIXTURE_TEST_CASE(), InputSlot::Insert(), and armnn::SelectTensorHandleStrategy().

+
178 {
179  m_EdgeStrategies[connectionIndex] = strategy;
180 }
+
+
+ +

◆ SetTensorHandleFactory()

+ +
+
+ + + + + + + + +
void SetTensorHandleFactory (const ITensorHandleFactory::FactoryIdid)
+
+ +

Definition at line 167 of file Layer.cpp.

+ +

Referenced by Graph::AddCompatibilityLayers(), and armnn::SelectTensorHandleStrategy().

+
168 {
169  m_TensorHandleFactoryId = id;
170 }
+
+
+ +

◆ SetTensorInfo()

+ +
+
+ + + + + +
+ + + + + + + + +
void SetTensorInfo (const TensorInfotensorInfo)
+
+overridevirtual
+
+
+ +

◆ ValidateTensorShape()

+ +
+
+ + + + + + + + +
bool ValidateTensorShape (const TensorShapeshape) const
+
+ +

Definition at line 73 of file Layer.cpp.

+
74 {
75  BOOST_ASSERT_MSG(IsTensorInfoSet(), "TensorInfo must be set in order to validate the shape.");
76  return shape == m_OutputHandler.GetTensorInfo().GetShape();
77 }
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
+
bool IsTensorInfoSet() const override
Definition: Layer.cpp:68
+
const TensorInfo & GetTensorInfo() const
Gets the matching TensorInfo for the output.
+
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1