!44881 fix a bug of BiasAddGrad when check

Merge pull request !44881 from huanghui/fix-BiasAddGrad
This commit is contained in:
i-robot 2022-11-01 07:00:16 +00:00 committed by Gitee
commit 0b25747876
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ int BiasAddGradGpuKernelMod::Resize(const BaseOperatorPtr &base_operator, const
data_format_ = input_device_format;
std::string format = GetValue<std::string>(base_operator->GetAttr("format"));
string::size_type pos = format.find("C");
if (pos == std::string::npos || pos >= num_dims_) {
if (pos == std::string::npos) {
MS_LOG(EXCEPTION) << "For '" << kernel_name_ << "', 'C' character must be in 'data_format', but got " << format;
}
if (pos >= num_dims_) {