Skip to content

Commit 50f012e

Browse files
committed
fix(aten::slice): Allow slicing of pytorch tensors
We could in the future allow evaluator / converter overwriting to do the slicing at compile time, but for now we are just going to freeze the tensor Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent af36b5b commit 50f012e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: core/conversion/converters/impl/select.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ auto select_registrations TRTORCH_UNUSED =
199199
.pattern(
200200
{"aten::slice.Tensor(Tensor(a) self, int dim=0, int start=0, int end=9223372036854775807, int step=1) -> Tensor(a)",
201201
[](ConversionCtx* ctx, const torch::jit::Node* n, args& args) -> bool {
202-
auto in = args[0].ITensor();
202+
auto in = args[0].ITensorOrFreeze(ctx);
203203
auto axis = args[1].unwrapToInt();
204204
auto maxDim = static_cast<int64_t>(in->getDimensions().d[axis]);
205205
// Handle case when given tensor index is negative

0 commit comments

Comments
 (0)