8 #include <doctest/doctest.h> 17 CHECK(m_LayerName ==
nullptr);
19 else if (m_LayerName ==
nullptr)
21 CHECK(name ==
nullptr);
25 CHECK_EQ(std::string(m_LayerName), std::string(name));
31 CHECK(layer !=
nullptr);
43 const unsigned char* expectedPtr =
static_cast<const unsigned char*
>(expected.
GetMemoryArea());
44 const unsigned char* actualPtr =
static_cast<const unsigned char*
>(actual.
GetMemoryArea());
45 for (
unsigned int i = 0; i < expected.
GetNumBytes(); i++)
47 CHECK(*(expectedPtr + i) == *(actualPtr + i));
55 CHECK(expected.
GetInfo() == actualInfo);
58 CHECK(expected.
GetNumBytes() == actualInfo.GetNumBytes());
59 if (expected.
GetNumBytes() == actualInfo.GetNumBytes())
62 const unsigned char* expectedPtr =
static_cast<const unsigned char*
>(expected.
GetMemoryArea());
63 const unsigned char* actualPtr =
static_cast<const unsigned char*
>(actual.
Map(
true));
64 for (
unsigned int i = 0; i < expected.
GetNumBytes(); i++)
66 CHECK(*(expectedPtr + i) == *(actualPtr + i));
74 const std::shared_ptr<ConstTensorHandle> actual)
76 if (expected ==
nullptr)
78 CHECK_MESSAGE(actual ==
nullptr, (name +
" actual should have been a nullptr"));
82 CHECK_MESSAGE(actual !=
nullptr, (name +
" actual should have been set"));
83 if (actual !=
nullptr)
94 if (expected ==
nullptr)
96 CHECK_MESSAGE(actual ==
nullptr, (name +
" actual should have been a nullptr"));
100 CHECK_MESSAGE(actual !=
nullptr, (name +
" actual should have been set"));
101 if (actual !=
nullptr)
void CheckLayerName(const char *name)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
virtual const void * Map(bool) const override
Map the tensor data for access.
void CheckLayerPointer(const IConnectableLayer *layer)
unsigned int GetNumElements() const
MemoryType GetMemoryArea() const
Copyright (c) 2021 ARM Limited and Contributors.
void CheckConstTensors(const ConstTensor &expected, const ConstTensor &actual)
const TensorInfo & GetTensorInfo() const
bool has_value() const noexcept
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
const TensorInfo & GetInfo() const
void CheckConstTensorPtrs(const std::string &name, const ConstTensor *expected, const ConstTensor *actual)
unsigned int GetNumDimensions() const
virtual void Unmap() const override
Unmap the tensor data.
void CheckOptionalConstTensors(const Optional< ConstTensor > &expected, const Optional< ConstTensor > &actual)
unsigned int GetNumBytes() const