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

Function IsEqualComputation

tensorflow/compiler/xrt/tests/raw_api_test.cc:257–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257xla::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
269void StoreComputationSnapshot(const xla::XlaComputation& computation,
270 xla::HloSnapshot* dst) {

Callers 1

TESTFunction · 0.85

Calls 9

ParameterFunction · 0.50
NeClass · 0.50
SubFunction · 0.50
ZeroFunction · 0.50
ConvertElementTypeFunction · 0.50
ReduceAllFunction · 0.50
element_typeMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected