ArmNN
 21.02
TestLayerVisitor.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
8 #include <armnn/Descriptors.hpp>
9 
10 namespace armnn
11 {
12 // Abstract base class with do nothing implementations for all layer visit methods
13 class TestLayerVisitor : public LayerVisitorBase<VisitorNoThrowPolicy>
14 {
15 protected:
16  virtual ~TestLayerVisitor() {}
17 
18  void CheckLayerName(const char* name);
19 
20  void CheckLayerPointer(const IConnectableLayer* layer);
21 
22  void CheckConstTensors(const ConstTensor& expected, const ConstTensor& actual);
23 
24  void CheckOptionalConstTensors(const Optional<ConstTensor>& expected, const Optional<ConstTensor>& actual);
25 
26 private:
27  const char* m_LayerName;
28 
29 public:
30  explicit TestLayerVisitor(const char* name) : m_LayerName(name)
31  {
32  if (name == nullptr)
33  {
34  m_LayerName = "";
35  }
36  }
37 };
38 
39 } //namespace armnn
void CheckLayerName(const char *name)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:62
TestLayerVisitor(const char *name)
void CheckLayerPointer(const IConnectableLayer *layer)
Copyright (c) 2021 ARM Limited and Contributors.
void CheckConstTensors(const ConstTensor &expected, const ConstTensor &actual)
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:314
Visitor base class with empty implementations.
void CheckOptionalConstTensors(const Optional< ConstTensor > &expected, const Optional< ConstTensor > &actual)