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

Method f

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

Source from the content-addressed store, hash-verified

128
129 @decorator
130 def f(x):
131 x1 = array_ops.identity(x)
132 with backprop.GradientTape() as t:
133 t.watch(x)
134 t.watch(x1)
135 y1 = x * 2.
136 y2 = x1 * 3.
137 loss = y1 + y2
138 return t.gradient(loss, [x, x1])
139
140 self.assertAllClose([2., 3.], f(constant_op.constant(10.)))
141

Callers

nothing calls this directly

Calls 11

gradientMethod · 0.80
cpuMethod · 0.80
multiplyMethod · 0.80
identityMethod · 0.45
GradientTapeMethod · 0.45
watchMethod · 0.45
constantMethod · 0.45
deviceMethod · 0.45
read_valueMethod · 0.45
addMethod · 0.45
gpuMethod · 0.45

Tested by

no test coverage detected