| 132 | } |
| 133 | |
| 134 | bool CompareLiteralProtos(const xla::LiteralProto& a, |
| 135 | const xla::LiteralProto& b) { |
| 136 | auto l_a = xla::Literal::CreateFromProto(a).ValueOrDie(); |
| 137 | auto l_b = xla::Literal::CreateFromProto(b).ValueOrDie(); |
| 138 | bool equal = l_a == l_b; |
| 139 | if (!equal) { |
| 140 | LOG(INFO) << "LiteralProtos don't match:\n" |
| 141 | << a.DebugString() << "\n!=\n" |
| 142 | << b.DebugString(); |
| 143 | } |
| 144 | return equal; |
| 145 | } |
| 146 | |
| 147 | bool CompareLiteralToLiteralProto(const xla::Literal& a, |
| 148 | const xla::LiteralProto& b) { |