- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharray_test.cpp
More file actions
Latest commit
24 lines (19 loc) · 650 Bytes
/
Copy patharray_test.cpp
File metadata and controls
24 lines (19 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<gtest/gtest.h>
#include<vector>
#include"array.h"
TEST(ArrayTest, MatrixMultiply) {
{
auto a = array_from_vector({0, 1, 2, 3}, {1, 2, 2});
auto b = array_from_vector({0, 1, 2, 3}, {2, 2, 1});
auto c = a % b;
EXPECT_EQ(c->shape, std::vector<int>({1, 2, 2, 1}));
EXPECT_EQ(c->data, std::vector<float>({2, 3, 6, 11}));
}
{
auto a = array_from_vector({0, 2, 1, 3}, {2, 2, 1});
auto b = array_from_vector({0, 2, 1, 3}, {1, 2, 2});
auto c = multiply_transpose(a, true, b, true);
EXPECT_EQ(c->shape, std::vector<int>({1, 2, 2, 1}));
EXPECT_EQ(c->data, std::vector<float>({2, 3, 6, 11}));
}
}