Browse Source

!13179 n_threads bug in PQC operator

From: @donghufeng
Reviewed-by: @zhoufeng54,@kisnwang
Signed-off-by: @kisnwang
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
e07a4f820d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/kernel_compiler/cpu/quantum/pqc_cpu_kernel.cc

+ 1
- 1
mindspore/ccsrc/backend/kernel_compiler/cpu/quantum/pqc_cpu_kernel.cc View File

@@ -175,7 +175,7 @@ void PQCCPUKernel::InitKernel(const CNodePtr &kernel_node) {

hams_ = mindquantum::transformer::HamiltoniansTransfor(hams_pauli_coeff_, hams_pauli_word_, hams_pauli_qubit_);

n_threads_user_ = common::ThreadPool::GetInstance().GetSyncRunThreadNum();
n_threads_user_ = std::min(n_threads_user_, common::ThreadPool::GetInstance().GetSyncRunThreadNum());
if (n_samples_ < n_threads_user_) {
n_threads_user_ = n_samples_;
}


Loading…
Cancel
Save