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

Method Encode

tensorflow/compiler/xla/cpu_function_runtime.h:71–76  ·  view source on GitHub ↗

Encodes this BufferInfo into two 64 bit integers that can be used to reconstruct the BufferInfo later using the constructor. We need this because we use BufferInfo in places where using protocol buffers would negatively impact binary size.

Source from the content-addressed store, hash-verified

69 // because we use BufferInfo in places where using protocol buffers would
70 // negatively impact binary size.
71 std::pair<tensorflow::uint64, tensorflow::uint64> Encode() const {
72 static_assert(sizeof(*this) == 16, "");
73 tensorflow::uint64 upper = Pack(kind(), size_);
74 tensorflow::uint64 lower = entry_param_number_;
75 return {upper, lower};
76 }
77
78 bool operator==(const BufferInfo& buffer_info) const {
79 if (kind() != buffer_info.kind() || size() != buffer_info.size()) {

Callers 2

CheckRoundTripIsOkFunction · 0.45

Calls 1

PackFunction · 0.50

Tested by 1

CheckRoundTripIsOkFunction · 0.36