MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / TEST

Function TEST

tests/layers_test.cc:8–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6};
7
8TEST(LayerTest, MakeRelativePositions1D) {
9 const StorageView positions = layers::make_relative_positions(1, 4, 2);
10 const StorageView expected({1, 4}, std::vector<int32_t>{0, 0, 1, 2});
11 expect_storage_eq(positions, expected);
12}
13
14TEST(LayerTest, MakeRelativePositions2D) {
15 const StorageView positions = layers::make_relative_positions(4, 4, 2);

Callers

nothing calls this directly

Calls 6

make_relative_positionsFunction · 0.85
expect_storage_eqFunction · 0.85
remove_paddingMethod · 0.80
rankMethod · 0.80
add_paddingMethod · 0.80

Tested by

no test coverage detected