Skip to content

Commit

Permalink
fix: add checks for whether or not the inputs and output have the sam…
Browse files Browse the repository at this point in the history
…e dimensions
  • Loading branch information
o2buzzle committed Apr 23, 2024
1 parent cf0aa0f commit 7e69239
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/include/miopen/pad_constant/problem_description.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,18 @@ struct ProblemDescription : ProblemDescriptionBase

NetworkConfig MakeNetworkConfig() const override;

bool IsSameType() const {
if (xDesc.GetType() == yDesc.GetType())
bool IsSameType() const
{
if(xDesc.GetType() == yDesc.GetType())
return true;
return false;
}

bool IsSameShape() const
{
auto xSize = xDesc.GetSize();
auto ySize = yDesc.GetSize();
if(xSize == ySize)
return true;
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/solver/pad_constant/pad_constant_fwd_contiguous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ bool PadConstantFwdContiguous::IsApplicable(
{
if(!problem.IsSameType())
return false;
if(!problem.IsSameShape())
return false;

return true;
}
Expand Down

0 comments on commit 7e69239

Please sign in to comment.