Skip to content
Snippets Groups Projects

Fuse bn

Merged Cyril Moineau requested to merge fuseBN into main
2 files
+ 7
4
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -27,14 +27,17 @@
* @tparam T should correspond to the type of the tensor, define the type of the absolute and relative error
* @param t1 first :cpp:class:`Aidge::Tensor` to test
* @param t2 second :cpp:class:`Aidge::Tensor` to test
* @param relative relative difference allowed
* @param absolute absolute error allowed
* @param relative relative difference allowed (should be betwen 0 and 1)
* @param absolute absolute error allowed (shoulmd be positive)
* @return true if both tensor are approximately equal and have the datatype, shape. Else return false
*/
template <typename T>
bool approxEq(Aidge::Tensor t1, Aidge::Tensor t2, float relative, float absolute){
assert(t1.dataType() == t2.dataType());
assert(t1.dataType() == NativeType<T>::type);
assert(relative >= 0);
assert(absolute >= 0 && absolute<=1);
if (t1.size() != t2.size()){
return false;
}
Loading