MCPcopy Create free account
hub / github.com/antirez/ds4 / tensor_expect_optional

Function tensor_expect_optional

ds4.c:3177–3185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3175 return (uint16_t)(sign | half_mant);
3176 }
3177
3178 if (exp >= 31) {
3179 if (((bits >> 23) & 0xffu) == 0xffu && mant != 0) {
3180 return (uint16_t)(sign | 0x7e00u);
3181 }
3182 return (uint16_t)(sign | 0x7c00u);
3183 }
3184
3185 uint32_t half = sign | ((uint32_t)exp << 10) | (mant >> 13);
3186 const uint32_t round = mant & 0x1fffu;
3187 if (round > 0x1000u || (round == 0x1000u && (half & 1u))) half++;
3188 return (uint16_t)half;

Callers 1

weights_validate_layoutFunction · 0.85

Calls 1

tensor_expect_layoutFunction · 0.85

Tested by

no test coverage detected