Skip to content

Commit 5f8287c

Browse files
committed
fix tests
1 parent 9db32aa commit 5f8287c

2 files changed

Lines changed: 7 additions & 21 deletions

File tree

src/layers/ConCatLayer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ void ConcatLayer::run(const std::vector<Tensor>& inputs, Tensor& output) {
1010
}
1111

1212
validate_inputs(inputs);
13-
int64_t normalized_axis = normalize_axis(inputs[0].get_shape().dims());
1413

1514
switch (inputs[0].get_type()) {
1615
case Type::kFloat:

test/single_layer/test_concatlayer.cpp

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,10 @@
66

77
using namespace it_lab_ai;
88

9-
class ConcatLayerTests : public ::testing::Test {
10-
protected:
11-
void SetUp() override {
12-
data1 = {1.0f, 2.0f, 3.0f, 4.0f};
13-
data2 = {5.0f, 6.0f, 7.0f, 8.0f};
14-
data_int = {1, 2, 3, 4};
15-
}
16-
17-
std::vector<float> data1;
18-
std::vector<float> data2;
19-
std::vector<int> data_int;
20-
};
21-
22-
TEST_F(ConcatLayerTests, ConcatSameShapeFloatAxis0) {
9+
TEST(ConcatLayerTests, ConcatSameShapeFloatAxis0) {
2310
ConcatLayer layer;
24-
Tensor input1 = make_tensor<float>(data1, {2, 2});
25-
Tensor input2 = make_tensor<float>(data2, {2, 2});
11+
Tensor input1 = make_tensor<float>({1.0f, 2.0f, 3.0f, 4.0f}, {2, 2});
12+
Tensor input2 = make_tensor<float>({5.0f, 6.0f, 7.0f, 8.0f}, {2, 2});
2613
Tensor output;
2714

2815
layer.run({input1, input2}, output);
@@ -40,7 +27,7 @@ TEST_F(ConcatLayerTests, ConcatSameShapeFloatAxis0) {
4027
EXPECT_FLOAT_EQ(output.get<float>({3, 1}), 8.0f);
4128
}
4229

43-
TEST_F(ConcatLayerTests, ConcatSameShapeIntAxis1) {
30+
TEST(ConcatLayerTests, ConcatSameShapeIntAxis1) {
4431
ConcatLayer layer(1);
4532
Tensor input1 = make_tensor<int>({1, 2, 3, 4}, {2, 2});
4633
Tensor input2 = make_tensor<int>({1, 2, 3, 4}, {2, 2});
@@ -61,7 +48,7 @@ TEST_F(ConcatLayerTests, ConcatSameShapeIntAxis1) {
6148
EXPECT_EQ(output.get<int>({1, 3}), 4);
6249
}
6350

64-
TEST_F(ConcatLayerTests, Concat3DTensorsAxis2) {
51+
TEST(ConcatLayerTests, Concat3DTensorsAxis2) {
6552
ConcatLayer layer(2);
6653
Tensor input1 = make_tensor<float>({1, 2, 3, 4, 5, 6, 7, 8}, {2, 2, 2});
6754
Tensor input2 =
@@ -93,7 +80,7 @@ TEST_F(ConcatLayerTests, Concat3DTensorsAxis2) {
9380
EXPECT_FLOAT_EQ(output.get<float>({1, 1, 3}), 16.0f);
9481
}
9582

96-
TEST_F(ConcatLayerTests, NegativeAxis) {
83+
TEST(ConcatLayerTests, NegativeAxis) {
9784
ConcatLayer layer(-1);
9885
Tensor input1 = make_tensor<float>({1.0f, 2.0f, 3.0f, 4.0f}, {2, 2});
9986
Tensor input2 = make_tensor<float>({5.0f, 6.0f, 7.0f, 8.0f}, {2, 2});
@@ -114,7 +101,7 @@ TEST_F(ConcatLayerTests, NegativeAxis) {
114101
EXPECT_FLOAT_EQ(output.get<float>({1, 3}), 8.0f);
115102
}
116103

117-
TEST_F(ConcatLayerTests, ConcatResNetStyle) {
104+
TEST(ConcatLayerTests, ConcatResNetStyle) {
118105
ConcatLayer layer(1);
119106
Tensor input1 = make_tensor<float>({1, 2, 3, 4, 5, 6, 7, 8}, {1, 2, 2, 2});
120107
Tensor input2 =

0 commit comments

Comments
 (0)