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

Function canonical

tensorflow/python/ops/array_ops.py:2976–2981  ·  view source on GitHub ↗
(x, c)

Source from the content-addressed store, hash-verified

2974 # PEP-8 naming
2975 # pylint: disable=invalid-name
2976 def canonical(x, c):
2977 if x is use_full_range:
2978 return valid_range[c] if stride > 0 else valid_range[(c + 1) & 1]
2979 else:
2980 x_fwd = size + x if x < 0 else x # make negative indices positive
2981 return max(valid_range[0], min(valid_range[1], x_fwd))
2982
2983 begin = canonical(spec.start, 0)
2984 end = canonical(spec.stop, 1)

Callers 2

ValidateStridedSliceOpFunction · 0.85

Calls 2

maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected