Skip to content

Commit

Permalink
formating changing
Browse files Browse the repository at this point in the history
  • Loading branch information
sdasgup3 committed Jan 30, 2024
1 parent 7bfd54f commit d9aeca6
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions stablehlo/dialect/StablehloOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1805,24 +1805,24 @@ void ReduceOp::build(OpBuilder&, OperationState& odsState, ValueRange inputs,
llvm::map_range(adaptor.getInitValues().getTypes(),
[](Type t) { return t.cast<ShapedType>(); })};

if (succeeded(hlo::verifyReduceOpInputsAndInferShape(
if (failed(hlo::verifyReduceOpInputsAndInferShape(
odsState.location, inputArgTensorTypes, dimensions, newDimensions,
encoding))) {
SmallVector<Type> inferredReturnTypes;
for (auto [inputTy, elementTy] :
llvm::zip(inputArgTensorTypes, elementTypes)) {
if (inputTy.hasRank()) {
inferredReturnTypes.push_back(
RankedTensorType::get(newDimensions, elementTy, encoding));
} else {
assert(encoding == nullptr && "attribute not supported");
inferredReturnTypes.push_back(UnrankedTensorType::get(elementTy));
}
}
odsState.addTypes(inferredReturnTypes);
} else {
encoding)))
llvm::report_fatal_error("Failed to infer result type(s).");

SmallVector<Type> inferredReturnTypes;
for (auto [inputTy, elementTy] :
llvm::zip(inputArgTensorTypes, elementTypes)) {
if (inputTy.hasRank()) {
inferredReturnTypes.push_back(
RankedTensorType::get(newDimensions, elementTy, encoding));
} else {
if (encoding != nullptr)
llvm::report_fatal_error("attribute not supported.");
inferredReturnTypes.push_back(UnrankedTensorType::get(elementTy));
}
}
odsState.addTypes(inferredReturnTypes);
}

LogicalResult ReduceOp::verify() {
Expand Down

0 comments on commit d9aeca6

Please sign in to comment.