Skip to content

Commit 32049eb

Browse files
committed
Merge remote-tracking branch 'origin/main' into avgpool
2 parents 25362c3 + 8d67c62 commit 32049eb

File tree

33 files changed

+370
-207
lines changed

33 files changed

+370
-207
lines changed

mlir-tensorrt/tensorrt/include/mlir-tensorrt-dialect/TensorRT/IR/TensorRTOps.td

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,18 +3510,21 @@ def TensorRT_ResizeNearestOp : TensorRT_Op<"resize_nearest", [Pure,
35103510

35113511
let arguments = (ins
35123512
TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>:$input,
3513+
Optional<TensorRT_ShapeTensor>:$output_shape,
35133514
OptionalAttr<DenseF32ArrayAttr>:$scales,
35143515
TensorRT_ResizeCoordinateTransformationAttr:$coordinateTransformation,
35153516
TensorRT_ResizeRoundModeAttr:$nearestRounding,
35163517
TensorRT_ResizeSelectorAttr:$selectorForSinglePixel
35173518
);
35183519
let results = (outs
35193520
TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>:$result);
3520-
let assemblyFormat = "attr-dict $input `:` type($input) `to` type($result)";
3521+
let assemblyFormat = "attr-dict $input ( `,` $output_shape^ )? `:` functional-type(operands,results) ";
35213522
let hasVerifier = 1;
35223523
let trtLayerAdd = [{
35233524
nvinfer1::IResizeLayer *layer = network->addResize(*$input);
3524-
if ($op.getScales().has_value())
3525+
if ($op.getOutputShape())
3526+
layer->setInput(1, *$output_shape);
3527+
else if ($op.getScales().has_value())
35253528
layer->setScales($scales.value().begin(), $scales.value().size());
35263529
else
35273530
layer->setOutputDimensions(getNvInferDims($op.getType().getShape()));
@@ -3576,17 +3579,20 @@ def TensorRT_ResizeLinearOp : TensorRT_Op<"resize_linear", [Pure,
35763579

35773580
let arguments = (ins
35783581
TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>:$input,
3582+
Optional<TensorRT_ShapeTensor>:$output_shape,
35793583
OptionalAttr<DenseF32ArrayAttr>:$scales,
35803584
TensorRT_ResizeCoordinateTransformationAttr:$coordinateTransformation,
35813585
TensorRT_ResizeSelectorAttr:$selectorForSinglePixel
35823586
);
35833587
let results = (outs
35843588
TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>:$result);
3585-
let assemblyFormat = "attr-dict $input `:` type($input) `to` type($result)";
3589+
let assemblyFormat = "attr-dict $input ( `,` $output_shape^ )? `:` functional-type(operands,results) ";
35863590
let hasVerifier = 1;
35873591
let trtLayerAdd = [{
35883592
nvinfer1::IResizeLayer *layer = network->addResize(*$input);
3589-
if ($op.getScales().has_value())
3593+
if ($op.getOutputShape())
3594+
layer->setInput(1, *$output_shape);
3595+
else if ($op.getScales().has_value())
35903596
layer->setScales($scales.value().begin(), $scales.value().size());
35913597
else
35923598
layer->setOutputDimensions(getNvInferDims($op.getType().getShape()));
@@ -3642,18 +3648,21 @@ def TensorRT_ResizeCubicOp : TensorRT_Op<"resize_cubic", [Pure,
36423648

36433649
let arguments = (ins
36443650
TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>:$input,
3651+
Optional<TensorRT_ShapeTensor>:$output_shape,
36453652
OptionalAttr<DenseF32ArrayAttr>:$scales,
36463653
TensorRT_ResizeCoordinateTransformationAttr:$coordinateTransformation,
36473654
TensorRT_ResizeSelectorAttr:$selectorForSinglePixel,
36483655
F32Attr:$cubicCoeff
36493656
);
36503657
let results = (outs
36513658
TensorRT_RankedTensorOf<[TensorRT_I8, F16, F32]>:$result);
3652-
let assemblyFormat = "attr-dict $input `:` type($input) `to` type($result)";
3659+
let assemblyFormat = "attr-dict $input ( `,` $output_shape^ )? `:` functional-type(operands,results) ";
36533660
let hasVerifier = 1;
36543661
let trtLayerAdd = [{
36553662
nvinfer1::IResizeLayer *layer = network->addResize(*$input);
3656-
if ($op.getScales().has_value())
3663+
if ($op.getOutputShape())
3664+
layer->setInput(1, *$output_shape);
3665+
else if ($op.getScales().has_value())
36573666
layer->setScales($scales.value().begin(), $scales.value().size());
36583667
else
36593668
layer->setOutputDimensions(getNvInferDims($op.getType().getShape()));

mlir-tensorrt/tensorrt/lib/TensorRT/IR/Verification.cpp

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -936,12 +936,12 @@ LogicalResult tensorrt::ResizeNearestOp::verify() {
936936
auto outputRank = outputType.getRank();
937937
const int64_t resizeDim = std::min(static_cast<int64_t>(3), outputRank);
938938
for (int64_t i = outputRank - 1; i >= 0; --i) {
939-
if (inputType.getDimSize(i) != outputType.getDimSize(i)) {
940-
if (outputRank - i > resizeDim) {
939+
if (inputType.isDynamicDim(i) || outputType.isDynamicDim(i))
940+
continue;
941+
if (inputType.getDimSize(i) != outputType.getDimSize(i))
942+
if (outputRank - i > resizeDim)
941943
return emitOpError("only supports resizing on the innermost min(3, "
942944
"rank(input)) dimensions");
943-
}
944-
}
945945
}
946946

947947
if (getScales().has_value()) {
@@ -954,14 +954,17 @@ LogicalResult tensorrt::ResizeNearestOp::verify() {
954954
"all scale values except innermost min(3, rank(input)) must be 1");
955955
}
956956

957-
for (int64_t i = 0; i < resizeDim; ++i) {
958-
if (inputType.isDynamicDim(outputRank - 1 - i) ||
959-
outputType.isDynamicDim(outputRank - 1 - i)) {
960-
if (!getScales().has_value())
957+
if (!getOutputShape()) {
958+
for (int64_t i = 0; i < resizeDim; ++i) {
959+
// output dims must be static or
960+
// scales is given and input dims are static
961+
if (outputType.isDynamicDim(outputRank - 1 - i) &&
962+
(inputType.isDynamicDim(outputRank - 1 - i) ||
963+
!getScales().has_value()))
961964
return emitOpError(
962-
"output innermost min(3, rank(input)) dimension that resize on "
963-
"cannot be dynamic when resize scales parameter is NOT "
964-
"specified");
965+
"input innermost min(3, rank(input)) dimension that resize on "
966+
"cannot be dynamic when output_shape parameter is NOT "
967+
"specified and it cannot be inferred statically");
965968
}
966969
}
967970
return success();
@@ -974,11 +977,14 @@ LogicalResult tensorrt::ResizeLinearOp::verify() {
974977

975978
auto outputRank = outputType.getRank();
976979
const int64_t resizeDim = std::min(static_cast<int64_t>(3), outputRank);
977-
for (int64_t i = outputRank - 1; i >= 0; --i)
980+
for (int64_t i = outputRank - 1; i >= 0; --i) {
981+
if (inputType.isDynamicDim(i) || outputType.isDynamicDim(i))
982+
continue;
978983
if (inputType.getDimSize(i) != outputType.getDimSize(i))
979984
if (outputRank - i > resizeDim)
980985
return emitOpError("only supports resizing on the innermost min(3, "
981986
"rank(input)) dimensions");
987+
}
982988

983989
if (getScales().has_value()) {
984990
if (static_cast<int64_t>(getScales().value().size()) != outputRank)
@@ -990,14 +996,17 @@ LogicalResult tensorrt::ResizeLinearOp::verify() {
990996
"all scale values except innermost min(3, rank(input)) must be 1");
991997
}
992998

993-
for (int64_t i = 0; i < resizeDim; ++i) {
994-
if (inputType.isDynamicDim(outputRank - 1 - i) ||
995-
inputType.isDynamicDim(outputRank - 1 - i)) {
996-
if (!getScales().has_value())
999+
if (!getOutputShape()) {
1000+
for (int64_t i = 0; i < resizeDim; ++i) {
1001+
// output dims must be static or
1002+
// scales is given and input dims are static
1003+
if (outputType.isDynamicDim(outputRank - 1 - i) &&
1004+
(inputType.isDynamicDim(outputRank - 1 - i) ||
1005+
!getScales().has_value()))
9971006
return emitOpError(
998-
"output innermost min(3, rank(input)) dimension that resize on "
999-
"cannot be dynamic when resize scales parameter is NOT "
1000-
"specified");
1007+
"input innermost min(3, rank(input)) dimension that resize on "
1008+
"cannot be dynamic when output_shape parameter is NOT "
1009+
"specified and it cannot be inferred statically");
10011010
}
10021011
}
10031012
// ResizeLinearOp impl end
@@ -1028,14 +1037,17 @@ LogicalResult tensorrt::ResizeCubicOp::verify() {
10281037
return emitOpError("all scale values except 2 innermost must be 1");
10291038
}
10301039

1031-
for (size_t i = 0; i < 2; ++i) {
1032-
if (inputType.isDynamicDim(outputRank - 1 - i) ||
1033-
inputType.isDynamicDim(outputRank - 1 - i)) {
1034-
if (!getScales().has_value())
1040+
if (!getOutputShape()) {
1041+
for (int64_t i = 0; i < 2; ++i) {
1042+
// output dims must be static or
1043+
// scales is given and input dims are static
1044+
if (outputType.isDynamicDim(outputRank - 1 - i) &&
1045+
(inputType.isDynamicDim(outputRank - 1 - i) ||
1046+
!getScales().has_value()))
10351047
return emitOpError(
1036-
"output innermost 2 dimensions that resize on "
1037-
"cannot be dynamic when resize scales parameter is NOT "
1038-
"specified");
1048+
"input innermost 2 dimensions that resize on "
1049+
"cannot be dynamic when output_shape parameter is NOT "
1050+
"specified and it cannot be inferred statically");
10391051
}
10401052
}
10411053

mlir-tensorrt/tensorrt/test/TensorRT/invalid.mlir

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ func.func @resize_nearest_static(%arg0: tensor<2x2x2x2x2xf32>) -> tensor<2x4x4x4
14521452
%0 = tensorrt.resize_nearest {
14531453
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
14541454
nearestRounding = #tensorrt.resize_round_mode<kFLOOR>,
1455-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2x2x2xf32> to tensor<2x4x4x4x4xf32>
1455+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2x2x2xf32>) -> tensor<2x4x4x4x4xf32>
14561456
return %0 : tensor<2x4x4x4x4xf32>
14571457
}
14581458

@@ -1464,18 +1464,18 @@ func.func @resize_nearest_static(%arg0: tensor<2x2x2x2xf32>) -> tensor<2x4x4x4xf
14641464
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
14651465
nearestRounding = #tensorrt.resize_round_mode<kFLOOR>,
14661466
scales = array<f32: 2.0, 3.0>,
1467-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2x2xf32> to tensor<2x4x4x4xf32>
1467+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2x2xf32>) -> tensor<2x4x4x4xf32>
14681468
return %0 : tensor<2x4x4x4xf32>
14691469
}
14701470

14711471
// -----
14721472

14731473
func.func @resize_nearest_dynamic(%arg0: tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x?x?xf32> {
1474-
// expected-error @below {{'tensorrt.resize_nearest' op output innermost min(3, rank(input)) dimension that resize on cannot be dynamic when resize scales parameter is NOT specified}}
1474+
// expected-error @below {{'tensorrt.resize_nearest' op input innermost min(3, rank(input)) dimension that resize on cannot be dynamic when output_shape parameter is NOT specified and it cannot be inferred statically}}
14751475
%0 = tensorrt.resize_nearest {
14761476
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
14771477
nearestRounding = #tensorrt.resize_round_mode<kFLOOR>,
1478-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2x?x?xf32> to tensor<2x2x2x?x?xf32>
1478+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x?x?xf32>
14791479
return %0 : tensor<2x2x2x?x?xf32>
14801480
}
14811481

@@ -1487,7 +1487,7 @@ func.func @resize_nearest_dynamic(%arg0: tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x
14871487
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
14881488
nearestRounding = #tensorrt.resize_round_mode<kFLOOR>,
14891489
scales = array<f32: 1.0, 1.0, 2.0, 2.0, 2.0>,
1490-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2x?x?xf32> to tensor<2x2x2x?x?xf32>
1490+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x?x?xf32>
14911491
return %0 : tensor<2x2x2x?x?xf32>
14921492
}
14931493

@@ -1499,7 +1499,7 @@ func.func @resize_nearest_dynamic(%arg0: tensor<2x2x2x?x?xf32>) -> tensor<2x4x4x
14991499
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
15001500
nearestRounding = #tensorrt.resize_round_mode<kFLOOR>,
15011501
scales = array<f32: 1.0, 2.0, 2.0, 2.0, 2.0>,
1502-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2x?x?xf32> to tensor<2x4x4x?x?xf32>
1502+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2x?x?xf32>) -> tensor<2x4x4x?x?xf32>
15031503
return %0 : tensor<2x4x4x?x?xf32>
15041504
}
15051505

@@ -1511,7 +1511,7 @@ func.func @resize_nearest_dynamic(%arg0: tensor<2x3xf32>) -> tensor<4x6xf16> {
15111511
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
15121512
nearestRounding = #tensorrt.resize_round_mode<kFLOOR>,
15131513
scales = array<f32: 2.0, 2.0>,
1514-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x3xf32> to tensor<4x6xf16>
1514+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x3xf32>) -> tensor<4x6xf16>
15151515
return %0 : tensor<4x6xf16>
15161516
}
15171517
// -----
@@ -1520,7 +1520,7 @@ func.func @resize_linear_static(%arg0: tensor<2x2x2x2x2xf32>) -> tensor<2x4x4x4x
15201520
// expected-error @below {{'tensorrt.resize_linear' op only supports resizing on the innermost min(3, rank(input)) dimensions}}
15211521
%0 = tensorrt.resize_linear {
15221522
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kALIGN_CORNERS>,
1523-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2x2x2xf32> to tensor<2x4x4x4x4xf32>
1523+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2x2x2xf32>) -> tensor<2x4x4x4x4xf32>
15241524
return %0 : tensor<2x4x4x4x4xf32>
15251525
}
15261526

@@ -1531,17 +1531,17 @@ func.func @resize_linear_static(%arg0: tensor<2x2x2x2x2xf32>) -> tensor<2x2x4x4x
15311531
%0 = tensorrt.resize_linear {
15321532
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kALIGN_CORNERS>,
15331533
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
1534-
scales = array<f32: 2.0, 3.0>} %arg0 : tensor<2x2x2x2x2xf32> to tensor<2x2x4x4x4xf32>
1534+
scales = array<f32: 2.0, 3.0>} %arg0 : (tensor<2x2x2x2x2xf32>) -> tensor<2x2x4x4x4xf32>
15351535
return %0 : tensor<2x2x4x4x4xf32>
15361536
}
15371537

15381538
// -----
15391539

15401540
func.func @resize_linear_dynamic(%arg0: tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x?x?xf32> {
1541-
// expected-error @below {{'tensorrt.resize_linear' op output innermost min(3, rank(input)) dimension that resize on cannot be dynamic when resize scales parameter is NOT specified}}
1541+
// expected-error @below {{'tensorrt.resize_linear' op input innermost min(3, rank(input)) dimension that resize on cannot be dynamic when output_shape parameter is NOT specified and it cannot be inferred statically}}
15421542
%0 = tensorrt.resize_linear {
15431543
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
1544-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2x?x?xf32> to tensor<2x2x2x?x?xf32>
1544+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x?x?xf32>
15451545
return %0 : tensor<2x2x2x?x?xf32>
15461546
}
15471547

@@ -1552,7 +1552,7 @@ func.func @resize_linear_dynamic(%arg0: tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x?
15521552
%0 = tensorrt.resize_linear {
15531553
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
15541554
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
1555-
scales = array<f32: 1.0, 1.0, 2.0, 3.0, 3.0>} %arg0 : tensor<2x2x2x?x?xf32> to tensor<2x2x2x?x?xf32>
1555+
scales = array<f32: 1.0, 1.0, 2.0, 3.0, 3.0>} %arg0 : (tensor<2x2x2x?x?xf32>) -> tensor<2x2x2x?x?xf32>
15561556
return %0 : tensor<2x2x2x?x?xf32>
15571557
}
15581558

@@ -1563,7 +1563,7 @@ func.func @resize_linear_dynamic(%arg0: tensor<2x2x2x3x3xf32>) -> tensor<2x4x4x9
15631563
%0 = tensorrt.resize_linear {
15641564
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
15651565
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
1566-
scales = array<f32: 1.0, 2.0, 2.0, 3.0, 3.0>} %arg0 : tensor<2x2x2x3x3xf32> to tensor<2x4x4x9x9xf32>
1566+
scales = array<f32: 1.0, 2.0, 2.0, 3.0, 3.0>} %arg0 : (tensor<2x2x2x3x3xf32>) -> tensor<2x4x4x9x9xf32>
15671567
return %0 : tensor<2x4x4x9x9xf32>
15681568
}
15691569

@@ -1574,7 +1574,7 @@ func.func @resize_linear_dynamic(%arg0: tensor<2x?xf32>) -> tensor<10x?xf32> {
15741574
%0 = tensorrt.resize_linear {
15751575
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
15761576
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
1577-
scales = array<f32: 4.0, 5.0>} %arg0 : tensor<2x?xf32> to tensor<10x?xf32>
1577+
scales = array<f32: 4.0, 5.0>} %arg0 : (tensor<2x?xf32>) -> tensor<10x?xf32>
15781578
return %0 : tensor<10x?xf32>
15791579
}
15801580

@@ -1585,7 +1585,7 @@ func.func @resize_cubic_rank1(%arg0: tensor<2xf32>) -> tensor<4xf32> {
15851585
%0 = tensorrt.resize_cubic {
15861586
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kALIGN_CORNERS>,
15871587
cubicCoeff = -0.75 : f32,
1588-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2xf32> to tensor<4xf32>
1588+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2xf32>) -> tensor<4xf32>
15891589
return %0 : tensor<4xf32>
15901590
}
15911591

@@ -1596,7 +1596,7 @@ func.func @resize_cubic_static(%arg0: tensor<2x2x2xf32>) -> tensor<4x4x4xf32> {
15961596
%0 = tensorrt.resize_cubic {
15971597
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kALIGN_CORNERS>,
15981598
cubicCoeff = -0.5 : f32,
1599-
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : tensor<2x2x2xf32> to tensor<4x4x4xf32>
1599+
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>} %arg0 : (tensor<2x2x2xf32>) -> tensor<4x4x4xf32>
16001600
return %0 : tensor<4x4x4xf32>
16011601
}
16021602

@@ -1608,18 +1608,18 @@ func.func @resize_cubic_static(%arg0: tensor<2x2x2xf32>) -> tensor<4x4x4xf32> {
16081608
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kALIGN_CORNERS>,
16091609
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
16101610
scales = array<f32: 1.0, 1.0, 2.0, 3.0, 3.0>,
1611-
cubicCoeff = -0.5 : f32} %arg0 : tensor<2x2x2xf32> to tensor<4x4x4xf32>
1611+
cubicCoeff = -0.5 : f32} %arg0 : (tensor<2x2x2xf32>) -> tensor<4x4x4xf32>
16121612
return %0 : tensor<4x4x4xf32>
16131613
}
16141614

16151615
// -----
16161616

16171617
func.func @resize_cubic_dynamic(%arg0: tensor<2x?x?xf32>) -> tensor<2x?x?xf32> {
1618-
// expected-error @below {{'tensorrt.resize_cubic' op output innermost 2 dimensions that resize on cannot be dynamic when resize scales parameter is NOT specified}}
1618+
// expected-error @below {{'tensorrt.resize_cubic' op input innermost 2 dimensions that resize on cannot be dynamic when output_shape parameter is NOT specified and it cannot be inferred statically}}
16191619
%0 = tensorrt.resize_cubic {
16201620
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
16211621
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
1622-
cubicCoeff = -1.0 : f32} %arg0 : tensor<2x?x?xf32> to tensor<2x?x?xf32>
1622+
cubicCoeff = -1.0 : f32} %arg0 : (tensor<2x?x?xf32>) -> tensor<2x?x?xf32>
16231623
return %0 : tensor<2x?x?xf32>
16241624
}
16251625

@@ -1631,7 +1631,7 @@ func.func @resize_cubic_dynamic(%arg0: tensor<2x2x?xf32>) -> tensor<2x4x?xf32> {
16311631
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
16321632
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
16331633
scales = array<f32: 1.0, 3.0, 3.0>,
1634-
cubicCoeff = -1.0 : f32} %arg0 : tensor<2x2x?xf32> to tensor<2x4x?xf32>
1634+
cubicCoeff = -1.0 : f32} %arg0 : (tensor<2x2x?xf32>) -> tensor<2x4x?xf32>
16351635
return %0 : tensor<2x4x?xf32>
16361636
}
16371637

@@ -1643,7 +1643,7 @@ func.func @resize_cubic_dynamic(%arg0: tensor<2x2x3x?xf32>) -> tensor<2x4x6x?xf3
16431643
coordinateTransformation = #tensorrt.resize_coordinate_transformation<kASYMMETRIC>,
16441644
selectorForSinglePixel = #tensorrt.resize_selector<kFORMULA>,
16451645
scales = array<f32: 1.0, 2.0, 2.0, 2.0>,
1646-
cubicCoeff = -1.0 : f32} %arg0 : tensor<2x2x3x?xf32> to tensor<2x4x6x?xf32>
1646+
cubicCoeff = -1.0 : f32} %arg0 : (tensor<2x2x3x?xf32>) -> tensor<2x4x6x?xf32>
16471647
return %0 : tensor<2x4x6x?xf32>
16481648
}
16491649

0 commit comments

Comments
 (0)