[nnc] Fix deconv unittest build (#2366)
authorEfimov Alexander/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Wed, 21 Nov 2018 19:10:05 +0000 (22:10 +0300)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 21 Nov 2018 19:10:05 +0000 (22:10 +0300)
Fix deconv unit test build and adjust float epsilon

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
contrib/nnc/unittests/soft_backend/CPPOperations.cpp

index 6b82e0a..c1d112d 100644 (file)
@@ -277,7 +277,7 @@ void compareResults(const mir::TensorVariant &ref_nnc_tensor, const Tensor &test
     // chosen epsilon lies near the edge of float type computational precision
     float ref_data = mir::Tensor<float>(ref_nnc_tensor).at(nnc_idx);
     float test_data = test_art_tensor.at(artifact_idx);
-    ASSERT_TRUE(areFloatsNear(ref_data, test_data, 32, 1e-6))
+    ASSERT_TRUE(areFloatsNear(ref_data, test_data, 32, 1e-5))
         << "Tensor element " << nnc_idx << " diverged, reference: " << ref_data << " test result: " << test_data;
   }
 }
@@ -466,9 +466,9 @@ TEST(cpp_operations_test, convTransposed2d)
               fillTensors(inputNTensors[0], aInputTensor, inputShapeData, 1.0f);
               auto padT = mir::ops::PaddingType::Same;
               mir::TensorVariant kernel = createNTensor(kernelShape, 1.0f);
-              auto opGenerator = [kernel, strides, padT](mir::Graph &g)
-              {
-                return g.create<mir::ops::DeConv2DOp>("y", kernel, strides, padT);
+              auto opGenerator = [kernel, strides, padT](mir::Graph &g,
+                                                         const std::vector<mir::IODescriptor>& inputs) {
+                return g.create<mir::ops::DeConv2DOp>("y", inputs[0], kernel, strides, padT);
               };
 
               createAndRunTestGraph(opGenerator, convTransposed2d, inputNTensors, aInputTensor);