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

Function numpy_reverse

tensorflow/compiler/tests/scan_ops_test.py:32–40  ·  view source on GitHub ↗
(x, axis)

Source from the content-addressed store, hash-verified

30
31
32def numpy_reverse(x, axis):
33 length = len(x.shape)
34 if axis < 0:
35 axis = length + axis
36
37 ix = [
38 slice(None, None, -1) if i == axis else slice(None) for i in range(length)
39 ]
40 return x[ix]
41
42
43def handle_options(func, x, axis, exclusive, reverse):

Callers 1

handle_optionsFunction · 0.70

Calls 2

sliceFunction · 0.50
rangeFunction · 0.50

Tested by

no test coverage detected