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

Method intersect

python/tvm/tirx/exec_context.py:86–96  ·  view source on GitHub ↗
(self, lo: int, hi: int)

Source from the content-addressed store, hash-verified

84 stride: int = 1
85
86 def intersect(self, lo: int, hi: int) -> AxisRange:
87 i_lo = max(0, _ceildiv(lo - self.offset, self.stride))
88 i_hi = min(self.extent, (hi - 1 - self.offset) // self.stride + 1)
89 if i_hi <= i_lo:
90 raise ExecContextError(
91 f"filter produces empty range: current=[{self.offset},"
92 f" {self.offset + self.extent}) ∩ [{lo}, {hi})"
93 )
94 return AxisRange(
95 extent=i_hi - i_lo, offset=self.offset + self.stride * i_lo, stride=self.stride
96 )
97
98 def modulo(self, modulus: int, residue: int) -> AxisRange:
99 residue %= modulus

Callers 1

filter_narrowFunction · 0.95

Calls 5

_ceildivFunction · 0.85
ExecContextErrorClass · 0.85
AxisRangeClass · 0.85
maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected