Skip to content

Commit

Permalink
[NeoMathEngine] SubVectorFromMatrixColumnsTest
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Golikov <[email protected]>
  • Loading branch information
favorart committed Jan 18, 2024
1 parent 97b2888 commit 6d85c03
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions NeoMathEngine/test/src/learn/SubVectorFromMatrixColumnsTest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright © 2017-2020 ABBYY Production LLC
/* Copyright © 2017-2024 ABBYY
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,10 +31,10 @@ static void subVectorFromMatrixColumnsTestImpl( const CTestParams& params, int s

CREATE_FILL_FLOAT_ARRAY( getMatrix, valuesInterval.Begin, valuesInterval.End, height * width, random )
CREATE_FILL_FLOAT_ARRAY( vector, valuesInterval.Begin, valuesInterval.End, height, random )
std::vector<float> expectedMatrix;
expectedMatrix = getMatrix;
std::vector<float> expectedMatrix = getMatrix; // copy vector

MathEngine().SubVectorFromMatrixColumns( CARRAY_FLOAT_WRAPPER( expectedMatrix ), CARRAY_FLOAT_WRAPPER( getMatrix ), height, width, CARRAY_FLOAT_WRAPPER( vector ) );
MathEngine().SubVectorFromMatrixColumns( CARRAY_FLOAT_WRAPPER( expectedMatrix ),
CARRAY_FLOAT_WRAPPER( getMatrix ), height, width, CARRAY_FLOAT_WRAPPER( vector ) );

for( int h = 0; h < height; ++h ) {
for( int w = 0; w < width; ++w ) {
Expand All @@ -47,7 +47,6 @@ static void subVectorFromMatrixColumnsTestImpl( const CTestParams& params, int s
}
}


//---------------------------------------------------------------------------------------------------------------------

class CSubVectorFromMatrixColumnsTest : public CTestFixtureWithParams {
Expand All @@ -58,19 +57,13 @@ INSTANTIATE_TEST_CASE_P( CSubVectorFromMatrixColumnsTestInstantiation, CSubVecto
CTestParams(
"Height = (1..50);"
"Width = (1..50);"
"BatchSize = (1..5);"
"VectorSize = (1..20);"
"Values = (-1..1);"
"Channels = (1..5);"
"TestCount = 100;"
),
CTestParams(
"Height = (100..500);"
"Width = (100..500);"
"BatchSize = (1..5);"
"VectorSize = (30..50);"
"Values = (-1..1);"
"Channels = (1..5);"
"TestCount = 5;"
)
)
Expand Down

0 comments on commit 6d85c03

Please sign in to comment.