Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ghpvnist committed Feb 21, 2025
1 parent 2bcd399 commit 71bf082
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions stablehlo/dialect/ChloOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ LogicalResult checkRaggedDotConstraints(

// Validate the actual shape, if it was passed as something other than [g].
if (rankedGroupSizesType.getRank() != 1) {
if (rankedGroupSizesType.getRank() != expectedPrefix.size() + 1) {
if (rankedGroupSizesType.getRank() !=
static_cast<int64_t>(expectedPrefix.size()) + 1) {
return emitOptionalError(location, "expected group_sizes to have rank ",
expectedPrefix.size() + 1, ", got ",
rankedGroupSizesType.getRank());
Expand All @@ -540,7 +541,7 @@ LogicalResult checkRaggedDotConstraints(
groupSizesShape.begin())) {
auto nonEmptyShapeStr = [](ArrayRef<int64_t> shape) {
std::string s = "";
for (int64_t i = 0; i < shape.size() - 1; ++i) {
for (size_t i = 0; i < shape.size() - 1; ++i) {
s += std::to_string(shape[i]) + ", ";
}
return s + std::to_string(shape.back());
Expand Down
2 changes: 1 addition & 1 deletion stablehlo/transforms/StablehloLegalizeQuantToMath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ Value createDotLikeKernel<stablehlo::ConvolutionOp>(
int64_t rank = cast<TensorType>(lhs.getType()).getRank();
SmallVector<int64_t> paddingLow(rank, 0), paddingHigh(rank, 0),
paddingInterior(rank, 0);
for (int64_t i = 0; i < dims.lhsSpatialDims.size(); ++i) {
for (size_t i = 0; i < dims.lhsSpatialDims.size(); ++i) {
paddingLow[dims.lhsSpatialDims[i]] = originalPadding[i * 2];
paddingHigh[dims.lhsSpatialDims[i]] = originalPadding[i * 2 + 1];
}
Expand Down

0 comments on commit 71bf082

Please sign in to comment.