!45622 [MS][GPU]fix bug of resize nearest neighborv2
Merge pull request !45622 from mengyuanli/fix_bug_of_resize
This commit is contained in:
commit
43831763ba
|
@ -63,9 +63,9 @@ class ResizeNearestNeighborGpuKernelMod : public NativeGpuKernelMod {
|
|||
return false;
|
||||
}
|
||||
CHECK_KERNEL_OUTPUTS_NUM(outputs.size(), 1, kernel_name_);
|
||||
auto kernel_ptr = std::dynamic_pointer_cast<ops::ResizeNearestNeighbor>(base_operator);
|
||||
MS_EXCEPTION_IF_NULL(kernel_ptr);
|
||||
align_corners_ = kernel_ptr->get_align_corners();
|
||||
auto prim = base_operator->GetPrim();
|
||||
MS_EXCEPTION_IF_NULL(prim);
|
||||
align_corners_ = GetValue<bool>(prim->GetAttr("align_corners"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,9 @@ class ResizeNearestNeighborGradGpuKernelMod : public NativeGpuKernelMod {
|
|||
kernel_name_ = base_operator->name();
|
||||
(void)CheckAndConvertUtils::CheckInteger(kInputNum, SizeToLong(inputs.size()), kLessEqual, kNumTwo, kernel_name_);
|
||||
(void)CheckAndConvertUtils::CheckInteger(kInputNum, SizeToLong(outputs.size()), kEqual, kNumOne, kernel_name_);
|
||||
auto prim = base_operator->GetPrim();
|
||||
MS_EXCEPTION_IF_NULL(prim);
|
||||
align_corners_ = GetValue<bool>(prim->GetAttr("align_corners"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -109,9 +112,6 @@ class ResizeNearestNeighborGradGpuKernelMod : public NativeGpuKernelMod {
|
|||
output_shape_.push_back(LongToInt(output_shape[i]));
|
||||
}
|
||||
output_size_ = sizeof(T) * SizeOf(output_shape);
|
||||
auto op_prim = std::dynamic_pointer_cast<ops::ResizeNearestNeighborGrad>(base_operator);
|
||||
MS_ERROR_IF_NULL_W_RET_VAL(op_prim, KRET_RESIZE_FAILED);
|
||||
align_corners_ = op_prim->get_align_corners();
|
||||
return KRET_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue