ONE - On-device Neural Engine
|
Class to compare two tensors (expected and obtained to compare) More...
#include <Comparator.h>
Data Structures | |
struct | Observer |
Struct to observe comparison results. More... | |
Public Member Functions | |
Comparator (const std::function< bool(float lhs, float rhs)> &fn) | |
Construct a new Comparator object. | |
std::vector< Diff< float > > | compare (const Shape &shape, const Reader< float > &expected, const Reader< float > &obtained, Observer *observer=nullptr) const |
Compare two tensors. | |
Class to compare two tensors (expected and obtained to compare)
Definition at line 45 of file Comparator.h.
|
inline |
Construct a new Comparator
object.
[in] | fn | Function that compares two float values |
Definition at line 52 of file Comparator.h.
std::vector< Diff< float > > nnfw::misc::tensor::Comparator::compare | ( | const Shape & | shape, |
const Reader< float > & | expected, | ||
const Reader< float > & | obtained, | ||
Observer * | observer = nullptr |
||
) | const |
Compare two tensors.
[in] | shape | Shape of two tensors |
[in] | expected | Reader<float> object that accesses expected tensor |
[in] | obtained | Reader<float> object that accesses obtained tensor |
[in] | observer | Observer notified of expected value and obtained value at every index |
std::vector<Diff<float>>
containing information of failed comparison Definition at line 29 of file Comparator.cpp.
References nnfw::misc::tensor::Comparator::Observer::notify(), and nnfw::misc::tensor::zip().