Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from torch import fx

import tvm
from tvm import relax, tir
from tvm import relax

from .base_fx_graph_translator import BaseFXGraphImporter

Expand Down Expand Up @@ -968,11 +968,11 @@ def _slice(self, node: fx.Node) -> relax.Var:
# tensor's own dimension size (common with dynamic shapes).
if isinstance(start, int) and start == 0 and isinstance(step, int) and step == 1:
in_shape = self.shape_of(x)
if in_shape is not None and isinstance(end_val, tir.PrimExpr):
if in_shape is not None and isinstance(end_val, tvm.tirx.PrimExpr):
actual_dim = dim if dim >= 0 else len(in_shape) + dim
dim_expr = in_shape[actual_dim]
if isinstance(dim_expr, tir.PrimExpr):
if tir.analysis.expr_deep_equal(end_val, dim_expr):
if isinstance(dim_expr, tvm.tirx.PrimExpr):
if tvm.tirx.analysis.expr_deep_equal(end_val, dim_expr):
return x

axes = [dim]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def main(x: R.Tensor((8, 9, 10), dtype="float32")) -> R.Tensor((8, 9, 3), dtype=

@T.prim_func(private=True)
def strided_slice(rxplaceholder: T.Buffer((T.int64(8), T.int64(9), T.int64(10)), "float32"), T_strided_slice_with_axes: T.Buffer((T.int64(8), T.int64(9), T.int64(3)), "float32")):
T.func_attr({"tir.noalias": True})
T.func_attr({"tirx.noalias": True})
for ax0, ax1, ax2 in T.grid(T.int64(8), T.int64(9), T.int64(3)):
with T.sblock("T_strided_slice_with_axes"):
v_ax0, v_ax1, v_ax2 = T.axis.remap("SSS", [ax0, ax1, ax2])
Expand Down
Loading