Merge pull request !38217 from chengbin/fix_nonzero_master
This commit is contained in:
i-robot 2022-07-18 09:31:36 +00:00 committed by Gitee
commit cfc9a44b39
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 2 deletions

View File

@ -32,11 +32,11 @@ void NonZeroCpuKernelMod::InitKernel(const CNodePtr &kernel_node) {
kernel_name_ = common::AnfAlgo::GetCNodeName(kernel_node);
auto input_shape = AnfAlgo::GetInputDeviceShape(kernel_node, 0);
auto output_shape = common::AnfAlgo::GetOutputInferShape(kernel_node, 0);
if (AnfAlgo::IsShapesDynamic({input_shape, output_shape})) {
if (AnfAlgo::IsShapesDynamic({input_shape})) {
return;
}
input_shape_ = Convert2SizeT(input_shape);
output_shape_ = Convert2SizeT(output_shape);
output_shape_ = Convert2SizeTClipNeg(output_shape);
input_rank_ = input_shape_.size();
node_wpt_ = kernel_node;
if (input_shape_.size() < kInputMinDim) {