mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
set max profile before opt profile (#7801)
This commit is contained in:
parent
ae14cedd63
commit
de4c221712
1 changed files with 2 additions and 3 deletions
|
|
@ -1544,9 +1544,8 @@ common::Status TensorrtExecutionProvider::Compile(const std::vector<Node*>& fuse
|
|||
*trt_profile = trt_builder->createOptimizationProfile();
|
||||
}
|
||||
(*trt_profile)->setShapeValues(input_name.c_str(), nvinfer1::OptProfileSelector::kMIN, &shapes_min[0], shape_size);
|
||||
(*trt_profile)->setShapeValues(input_name.c_str(), nvinfer1::OptProfileSelector::kOPT, &shapes_opt[0], shape_size);
|
||||
(*trt_profile)->setShapeValues(input_name.c_str(), nvinfer1::OptProfileSelector::kMAX, &shapes_max[0], shape_size);
|
||||
|
||||
(*trt_profile)->setShapeValues(input_name.c_str(), nvinfer1::OptProfileSelector::kOPT, &shapes_opt[0], shape_size);
|
||||
} else { // Execution tensor
|
||||
nvinfer1::Dims dims_min(dims), dims_opt(dims), dims_max(dims);
|
||||
for (int j = 0, end = nb_dims; j < end; ++j) {
|
||||
|
|
@ -1576,8 +1575,8 @@ common::Status TensorrtExecutionProvider::Compile(const std::vector<Node*>& fuse
|
|||
*trt_profile = trt_builder->createOptimizationProfile();
|
||||
}
|
||||
(*trt_profile)->setDimensions(input_name.c_str(), nvinfer1::OptProfileSelector::kMIN, dims_min);
|
||||
(*trt_profile)->setDimensions(input_name.c_str(), nvinfer1::OptProfileSelector::kOPT, dims_opt);
|
||||
(*trt_profile)->setDimensions(input_name.c_str(), nvinfer1::OptProfileSelector::kMAX, dims_max);
|
||||
(*trt_profile)->setDimensions(input_name.c_str(), nvinfer1::OptProfileSelector::kOPT, dims_opt);
|
||||
}
|
||||
ort.ReleaseTensorTypeAndShapeInfo(tensor_info);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue