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

Function numpy_reverse

tensorflow/python/kernel_tests/scan_ops_test.py:33–41  ·  view source on GitHub ↗
(x, axis)

Source from the content-addressed store, hash-verified

31
32
33def numpy_reverse(x, axis):
34 length = len(x.shape)
35 if axis < 0:
36 axis = length + axis
37
38 ix = [
39 slice(None, None, -1) if i == axis else slice(None) for i in range(length)
40 ]
41 return x[ix]
42
43
44def 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