File tree 2 files changed +5
-4
lines changed
mlir-tensorrt/tensorrt/lib
Target/TensorRTEncodingOpInterface
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -371,9 +371,8 @@ nvinfer1::ILayer *NvInferNetworkEncoder::addFillLayer(
371
371
nvinfer1::Dims shapeDims = dynamicShape->getDimensions ();
372
372
assert (shapeDims.nbDims == 1 && shapeDims.d [0 ] > 0 &&
373
373
" invalid shape tensor shape" );
374
- staticShape.nbDims = shapeDims.d [0 ];
375
- for (int32_t i = 0 ; i < shapeDims.nbDims ; i++)
376
- staticShape.d [i] = 1 ;
374
+ staticShape.nbDims = 1 ;
375
+ staticShape.d [0 ] = 1 ;
377
376
}
378
377
nvinfer1::IFillLayer *layer =
379
378
network->addFill (staticShape, fillOperation, elementType);
Original file line number Diff line number Diff line change @@ -117,7 +117,9 @@ LogicalResult tensorrt::LinspaceOp::verify() {
117
117
if (getStep () == nullptr )
118
118
return emitOpError (" dynamic `step` must be specified if the result is "
119
119
" greater than rank 1" );
120
- if (getStep ().getType ().getDimSize (0 ) != getType ().getRank ())
120
+ TensorType stepType = getStep ().getType ();
121
+ if (!stepType.isDynamicDim (0 ) &&
122
+ stepType.getDimSize (0 ) != getType ().getRank ())
121
123
return emitOpError (" dynamic `step` type dimension 0 length must be the "
122
124
" same size as the rank of the result type" );
123
125
}
You can’t perform that action at this time.
0 commit comments