Skip to content

Commit

Permalink
[Bug Fix] Fix AdaptivePool2d for ORT (PaddlePaddle#767)
Browse files Browse the repository at this point in the history
fix adaptivepool2d
  • Loading branch information
yeliang2258 authored Dec 1, 2022
1 parent 5a0eaa1 commit 11995e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastdeploy/backends/ort/ops/adaptive_pool2d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void AdaptivePool2dKernel::Compute(OrtKernelContext* context) {
context, 0, output_size_.data(), output_size_.size());

float* output_data = ort_.GetTensorMutableData<float>(output);
if(this->provider_ == "CUDAExecutionProvider"){
if(!strcmp(this->provider_, "CUDAExecutionProvider")){
#ifdef WITH_GPU
auto compute_stream = ort_.KernelContext_GetGPUComputeStream(context);
CudaAdaptivePool(input_size, output_size_, output_data, input_data, compute_stream, pooling_type_);
Expand All @@ -85,7 +85,7 @@ void AdaptivePool2dKernel::Compute(OrtKernelContext* context) {
<< "Will force to use CPU to run." << std::endl;
CpuAdaptivePool(input_size, output_size_, input_data, output_data);
#endif
}else{
} else {
CpuAdaptivePool(input_size, output_size_, input_data, output_data);
}
}
Expand Down

0 comments on commit 11995e5

Please sign in to comment.