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

Method fn

tensorflow/python/kernel_tests/cond_v2_test.py:1130–1133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1128 ops.add_to_collection("x", x)
1129 ops.add_to_collection("y", y)
1130 def fn():
1131 x_const = constant_op.constant(ops.get_collection("x")[0])
1132 y_const = constant_op.constant(ops.get_collection("y")[0])
1133 return math_ops.add(x_const, y_const)
1134
1135 cnd = cond_v2.cond_v2(constant_op.constant(True), fn, fn)
1136 self.assertEquals(cnd.eval(), 7)

Callers

nothing calls this directly

Calls 3

constantMethod · 0.45
get_collectionMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected