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

Function TEST

tests/decoding_test.cc:5–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "test_utils.h"
4
5TEST(DecodingTest, DisableTokens) {
6 StorageView input({2, 5}, std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
7 StorageView expected({2, 5}, std::vector<float>{1, 0, 0, 4, 5, 6, 7, 0, 9, 0});
8
9 DisableTokens disable_tokens(input, 0);
10 disable_tokens.add(2);
11 disable_tokens.add(0, 1);
12 disable_tokens.add(1, 4);
13 disable_tokens.apply();
14
15 expect_storage_eq(input, expected);
16}

Callers

nothing calls this directly

Calls 3

expect_storage_eqFunction · 0.85
addMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected