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

Method CreateMapPlusN

tensorflow/compiler/xla/tests/map_test.cc:125–135  ·  view source on GitHub ↗

Creates a function that takes a single parameter and calls map with "embedded_computation" on it, and then adds "n" to the result. x {R0F32} -----------> (map) ----> (add) / / embedded_computation --/ n --/

Source from the content-addressed store, hash-verified

123 // / /
124 // embedded_computation --/ n --/
125 XlaComputation CreateMapPlusN(const XlaComputation& embedded_computation,
126 float n) {
127 XlaBuilder builder(TestName());
128 auto x = Parameter(&builder, 0, ShapeUtil::MakeShape(F32, {}), "x");
129 auto map = Map(&builder, {x}, embedded_computation, {});
130 auto constant_n = ConstantR0<float>(&builder, n);
131 Add(map, constant_n);
132 auto computation_status = builder.Build();
133 TF_CHECK_OK(computation_status.status());
134 return computation_status.ConsumeValueOrDie();
135 }
136
137 // Creates a binary function with signature (F32, F32) -> Pred
138 // defined by (x, y) -> x > y.

Callers

nothing calls this directly

Calls 8

TestNameFunction · 0.85
MakeShapeFunction · 0.85
MapFunction · 0.85
ConsumeValueOrDieMethod · 0.80
ParameterFunction · 0.50
AddClass · 0.50
BuildMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected