MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / TEST

Function TEST

oneflow/core/common/bfloat16_test.cpp:37–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37TEST(BFLOAT16MATH, Add) {
38 // 6.25
39 float input = float_from_bytes(0, 0, 0x40C80000U);
40 // 7.25
41 float expected = float_from_bytes(0, 0, 0x40E80000U);
42
43 bfloat16 b(input);
44 b = b + 1;
45
46 float res = static_cast<float>(b);
47 EXPECT_EQ(res, expected);
48}
49
50TEST(BFLOAT16MATH, Sub) {
51 // 7.25

Callers

nothing calls this directly

Calls 4

float_from_bytesFunction · 0.85
log2Function · 0.85
log10Function · 0.85
sqrtFunction · 0.85

Tested by

no test coverage detected