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

Method loop_fn

tensorflow/python/ops/parallel_for/array_test.py:42–53  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

40 x = random_ops.random_uniform([3, 3, 3])
41
42 def loop_fn(i):
43 outputs = []
44 x_i = array_ops.gather(x, i)
45 for y in [x, x_i]:
46 axes = [0, 2, -1] if y is x else [0]
47 for axis in axes:
48 outputs.append(array_ops.gather(y, 2, axis=axis))
49 outputs.append(array_ops.gather(y, i, axis=axis))
50 outputs.append(array_ops.gather(y, [i], axis=axis))
51 outputs.append(array_ops.gather(y, [i, 2], axis=axis))
52 outputs.append(array_ops.gather(y, [[2, i], [i, 1]], axis=axis))
53 return outputs
54
55 self._test_loop_fn(loop_fn, 3, loop_fn_dtypes=[dtypes.float32] * 20)
56

Callers

nothing calls this directly

Calls 15

reshapeMethod · 0.80
broadcast_toMethod · 0.80
sliceMethod · 0.80
tileMethod · 0.80
transposeMethod · 0.80
gradientMethod · 0.80
opFunction · 0.50
gatherMethod · 0.45
appendMethod · 0.45
shapeMethod · 0.45
sizeMethod · 0.45
rankMethod · 0.45

Tested by

no test coverage detected