MCPcopy Create free account
hub / github.com/apache/tvm / __reflect

Function __reflect

python/tvm/topi/testing/grid_sample_python.py:74–79  ·  view source on GitHub ↗
(index, size, corner_start)

Source from the content-addressed store, hash-verified

72 def _reflect_coordinates(i, size):
73 def __refelection(i, size, corner_start):
74 def __reflect(index, size, corner_start):
75 index_align_corner = abs(corner_start - index)
76 size_times = index_align_corner // size
77 even = size_times % 2 == 0
78 extra = index_align_corner - size_times * size
79 return extra + corner_start if even else size - extra + corner_start
80
81 if corner_start <= i <= size + corner_start:
82 new_i = i

Callers 1

__refelectionFunction · 0.70

Calls 1

absFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…