| 36 | |
| 37 | template <typename T, typename U> |
| 38 | T BitCast(U src) { |
| 39 | static_assert(sizeof(T) == sizeof(U), "sizes don't match"); |
| 40 | // We would like to check std::is_trivially_copyable here, but there's no |
| 41 | // reliable implementation of that available to us. |
| 42 | return absl::bit_cast<T>(src); |
| 43 | } |
| 44 | |
| 45 | template <> |
| 46 | inline tensorflow::bfloat16 BitCast<tensorflow::bfloat16, uint16_t>( |
no outgoing calls
no test coverage detected