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

Method f

tensorflow/python/kernel_tests/relu_op_test.py:138–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136 return tape.gradient(y, x)
137
138 def f():
139 with test_util.use_gpu():
140 # Randomly construct a 1D shape from [1, 40)
141 shape = random_ops.random_uniform([1],
142 minval=1,
143 maxval=40,
144 dtype=dtypes.int32)
145 x32 = random_ops.random_uniform(shape, minval=-1, maxval=1)
146 x16 = math_ops.cast(x32, dtype=dtypes.float16)
147 return grad(x32), grad(x16)
148
149 # We're going to ensure that the fp16 and fp32 gradients
150 # are "close" to each other for ~100 random values.

Callers

nothing calls this directly

Calls 6

random_uniformMethod · 0.80
gradientMethod · 0.80
gradFunction · 0.50
castMethod · 0.45
GradientTapeMethod · 0.45
watchMethod · 0.45

Tested by

no test coverage detected