Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/plugins/intel_gpu/src/graph/error_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ void error_on_tensor_dims_not_dividable_by_other_tensor_dims(const std::string&
const tensor& tens_to_compre,
const std::string& additional_message) {
std::vector<std::string> errors;
if (tens.batch[0] % tens_to_compre.batch[0] != 0) {
if (tens_to_compre.batch[0] != 0 && tens.batch[0] % tens_to_compre.batch[0] != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add division by zero as an additional error?

Suggested change
if (tens_to_compre.batch[0] != 0 && tens.batch[0] % tens_to_compre.batch[0] != 0) {
if (tens_to_compre.batch[0] == 0 || tens.batch[0] % tens_to_compre.batch[0] != 0) {

The same applies to other conditions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case, the tens.batch[0] is 0 as well

errors.push_back("Batch");
}
if (tens.feature[0] % tens_to_compre.feature[0] != 0) {
if (tens_to_compre.feature[0] != 0 && tens.feature[0] % tens_to_compre.feature[0] != 0) {
errors.push_back("Feature");
}
if (tens.spatial[0] % tens_to_compre.spatial[0] != 0) {
if (tens_to_compre.spatial[0] != 0 && tens.spatial[0] % tens_to_compre.spatial[0] != 0) {
errors.push_back("Spatial x");
}
if (tens.spatial[1] % tens_to_compre.spatial[1] != 0) {
if (tens_to_compre.spatial[1] != 0 && tens.spatial[1] % tens_to_compre.spatial[1] != 0) {
errors.push_back("Spatial y");
}

Expand Down
Loading