MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CopyToBuffer

Function CopyToBuffer

tensorflow/core/kernels/fingerprint_op.cc:30–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace {
29template <typename T>
30inline void CopyToBuffer(const T& value, uint8* output) {
31 // Memcpy to string is endian-dependent. We choose little-endian as
32 // standard. On big-endian machines, bytes should be reversed.
33#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
34 static_assert(port::kLittleEndian, "");
35 std::memcpy(output, &value, sizeof(value));
36#else
37 static_assert(!port::kLittleEndian, "");
38 std::reverse_copy(reinterpret_cast<const uint8*>(&value),
39 reinterpret_cast<const uint8*>(&value + 1), output);
40#endif
41}
42
43void FarmhashFingerprint64(TTypes<uint8, 2>::ConstTensor input,
44 TTypes<uint8, 2>::Matrix output) {

Callers 1

FarmhashFingerprint64Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected