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

Method fn

tensorflow/python/eager/backprop_test.py:56–63  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

54 def testAggregateGradients(self):
55
56 def fn(x):
57 ind1 = constant_op.constant(np.array([0, 1]))
58 ind2 = constant_op.constant(np.array([2, 3]))
59 ind3 = constant_op.constant(np.array([1, 3]))
60 g1 = embedding_ops.embedding_lookup(x, ind1)
61 g2 = embedding_ops.embedding_lookup(x, ind2)
62 g3 = embedding_ops.embedding_lookup(x, ind3)
63 return g1 * g2 * g3
64
65 var_np = np.random.rand(4, 2).astype(np.float32)
66 var = constant_op.constant(var_np)

Callers

nothing calls this directly

Calls 9

reduce_sumMethod · 0.80
cpuMethod · 0.80
reduce_meanMethod · 0.80
constantMethod · 0.45
addMethod · 0.45
valueMethod · 0.45
deviceMethod · 0.45
gpuMethod · 0.45
stackMethod · 0.45

Tested by

no test coverage detected