Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenNMT/CTranslate2
/ bit_cast
Function
bit_cast
include/ctranslate2/bfloat16.h:13–17 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
11
12
template <typename T, typename U>
13
inline T bit_cast(const U &u) {
14
T t;
15
std::memcpy(&t, &u, sizeof(U));
16
return t;
17
}
18
19
class bfloat16_t {
20
public:
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected