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.
| 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()) { |