| 255 | } |
| 256 | |
| 257 | xla::XlaComputation IsEqualComputation(const xla::Shape& shape) { |
| 258 | xla::XlaBuilder builder("IsEqualComputation"); |
| 259 | auto p0 = xla::Parameter(&builder, 0, shape, "P0"); |
| 260 | auto p1 = xla::Parameter(&builder, 1, shape, "P1"); |
| 261 | auto cmp = |
| 262 | xla::Ne(xla::Sub(p0, p1), xla::Zero(&builder, shape.element_type())); |
| 263 | auto icmp = xla::ConvertElementType(cmp, xla::S32); |
| 264 | xla::ReduceAll(icmp, xla::Zero(&builder, xla::S32), |
| 265 | xla::CreateScalarAddComputation(xla::S32, &builder)); |
| 266 | return builder.Build().ValueOrDie(); |
| 267 | } |
| 268 | |
| 269 | void StoreComputationSnapshot(const xla::XlaComputation& computation, |
| 270 | xla::HloSnapshot* dst) { |
no test coverage detected