MCPcopy Create free account
hub / github.com/cactus-compute/cactus / test_concat

Function test_concat

tests/test_graph.cpp:43–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool test_concat() {
44 TestUtils::FP16TestFixture fixture("Concat");
45
46 size_t input_a = fixture.create_input({2, 3});
47 size_t input_b = fixture.create_input({2, 5});
48 size_t concat_result = fixture.graph().concat(input_a, input_b, 1);
49
50 std::vector<__fp16> data_a = {1, 2, 3, 4, 5, 6};
51 std::vector<__fp16> data_b = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
52 std::vector<__fp16> expected = {1, 2, 3, 1, 2, 3, 4, 5, 4, 5, 6, 6, 7, 8, 9, 10};
53 fixture.set_input_data(input_a, data_a);
54 fixture.set_input_data(input_b, data_b);
55 fixture.execute();
56
57 return fixture.verify_output(concat_result, expected);
58}
59
60bool test_cat() {
61 TestUtils::FP16TestFixture fixture("Cat (multiple input tensors)");

Callers 1

mainFunction · 0.85

Calls 5

create_inputMethod · 0.80
set_input_dataMethod · 0.80
verify_outputMethod · 0.80
concatMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected