-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix shape check many by hongyu #16840
Conversation
PADDLE_ENFORCE_EQ(x_dims[1], y_dims[1], | ||
"The dim 1 of X and Y must be the same."); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more simply:
if (ctx->IsRuntime() || (framework::product(x_dims) > 0 && framework::product(y_dims))) {
PADDLE_ENFORCE_EQ(x_dims, y_dims, ...)
}
但这个check没有当前的code严格
x_dims, y_dims, | ||
"Minus operator must take two tensor with same num of elements"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For short lines:
if ( ctx->IsRuntime() || (framework::product(x_dims) > 0 && framework::product(y_dims) > 0) ) {
}
PADDLE_ENFORCE_EQ(x_dims[1], y_dims[1], | ||
"The dim 1 of X and Y must be the same."); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
… fix_shape_check_many
fix shape check many by hongyu
Merge pull request #16840 from phlrain/fix_shape_check_many
tensor_array_read_write_op.cc
data_norm_op.cc
huber_loss_op.cc
layer_norm_op.cc
precision_recall_op.cc
minus_op.cc
modified_huber_loss_op.cc
space_to_depth_op.cc
tree_conv_op.cc