forked from mindspore-Ecosystem/mindspore
!48597 complex cpu null check
Merge pull request !48597 from chenweifeng/complex-null-check-1
This commit is contained in:
commit
28fc7534e2
|
@ -74,6 +74,13 @@ int ComplexCpuKernelMod::Resize(const BaseOperatorPtr &base_operator, const std:
|
|||
image_shape_ = inputs[1]->GetShapeVector();
|
||||
out_shape_ = outputs[0]->GetShapeVector();
|
||||
|
||||
is_null_input_ = CHECK_SHAPE_NULL(real_shape_, kernel_name_, "real") ||
|
||||
CHECK_SHAPE_NULL(image_shape_, kernel_name_, "image") ||
|
||||
CHECK_SHAPE_NULL(out_shape_, kernel_name_, "output");
|
||||
if (is_null_input_) {
|
||||
return KRET_OK;
|
||||
}
|
||||
|
||||
real_bcast_.clear();
|
||||
image_bcast_.clear();
|
||||
auto real_offset = out_shape_.size() - real_shape_.size();
|
||||
|
@ -97,7 +104,7 @@ int ComplexCpuKernelMod::Resize(const BaseOperatorPtr &base_operator, const std:
|
|||
|
||||
template <typename T>
|
||||
bool ComplexCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &outputs) {
|
||||
if (out_shape_.size() == 0) {
|
||||
if (is_null_input_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,8 @@ class ComplexCpuKernelMod : public NativeCpuKernelMod {
|
|||
|
||||
std::vector<int64_t> real_bcast_;
|
||||
std::vector<int64_t> image_bcast_;
|
||||
|
||||
bool is_null_input_{false};
|
||||
};
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
Loading…
Reference in New Issue