Skip to content

Commit

Permalink
add TensorTests and QuantziersTests to makefile
Browse files Browse the repository at this point in the history
fix build errors on Linux
  • Loading branch information
zhouwangzw committed Sep 1, 2016
1 parent 1708674 commit 07eff6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,8 @@ UNITTEST_MATH_SRC = \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/CPUMatrixTests.cpp \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/CPUSparseMatrixTests.cpp \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/fixtures.cpp \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/QuantizersTests.cpp \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/TensorTests.cpp \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/GPUMatrixCudaBlasTests.cpp \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/GPUMatrixTests.cpp \
$(SOURCEDIR)/../Tests/UnitTests/MathTests/GPUSparseMatrixTests.cpp \
Expand Down
2 changes: 1 addition & 1 deletion Source/Math/Quantizers.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class SymmetricQuantizer : public QuantizerBase<RawType, QuantizedType>
LogicError("The absolute max element in the sequence to be quantized is 0.");
}
m_absMax = absoluteMax;
m_quantizeFactor = rangeMax / shiftedMax;
m_quantizeFactor = this->rangeMax / shiftedMax;
m_inverseQuantizerFactor = 1 / m_quantizeFactor;
}
};
Expand Down
10 changes: 5 additions & 5 deletions Tests/UnitTests/MathTests/TensorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BOOST_AUTO_TEST_CASE(ElementwiseAddition)
// elementwise sum
tensorTester.OneTensorTest("elementwise addition", 1e-8, [&tensorTester](DEVICEID_TYPE deviceId)
{
return tensorTester.BroadcastingTest(TensorShape{ 512, 256 }, TensorShape({ 512, 256 }), deviceId);
return tensorTester.BroadcastingTest(TensorShape{ 512, 256 }, TensorShape{ 512, 256 }, deviceId);
});
}

Expand All @@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(AdditionWithSimpleBroadcasting)
// simple broadcasting
tensorTester.OneTensorTest("addition wth simple broadcasting", 1e-8, [&tensorTester](DEVICEID_TYPE deviceId)
{
return tensorTester.BroadcastingTest(TensorShape{ 3, 2 }, TensorShape({ 3, 1 }), deviceId);
return tensorTester.BroadcastingTest(TensorShape{ 3, 2 }, TensorShape{ 3, 1 }, deviceId);
});
}

Expand All @@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE(BiasAddition)
// typical bias for convolutional layer
tensorTester.OneTensorTest("bias addition (broadcasting)", 1e-8, [&tensorTester](DEVICEID_TYPE deviceId)
{
return tensorTester.BroadcastingTest(TensorShape{ 28, 28, 128, 32 }, TensorShape({ 1, 1, 128 }), deviceId);
return tensorTester.BroadcastingTest(TensorShape{ 28, 28, 128, 32 }, TensorShape{ 1, 1, 128 }, deviceId);
});
}

Expand All @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(BiasAddition2)
// Something fishy going on. Dimension overflow?
tensorTester.OneTensorTest("bias addition (broadcasting)", 1e-8, [&tensorTester](DEVICEID_TYPE deviceId)
{
return tensorTester.BroadcastingTest(TensorShape{ 256, 256, 64, 32 }, TensorShape({ 1, 1, 64 }), deviceId);
return tensorTester.BroadcastingTest(TensorShape{ 256, 256, 64, 32 }, TensorShape{ 1, 1, 64 }, deviceId);
});
}

Expand All @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(BiasGradient2)
// typical bias gradient (reduction) for convolutional layer
tensorTester.OneTensorTest("bias gradient (reduction)", 1e-1, [&tensorTester](DEVICEID_TYPE deviceId)
{
return tensorTester.BiasGradientTest(TensorShape{ 256, 256, 64, 32 }, TensorShape({ 1, 1, 64 }), deviceId);
return tensorTester.BiasGradientTest(TensorShape{ 256, 256, 64, 32 }, TensorShape{ 1, 1, 64 }, deviceId);
});
}

Expand Down

0 comments on commit 07eff6b

Please sign in to comment.