Skip to content

Commit

Permalink
Merge pull request #187 from Xilinx/ljfitz_merge_release
Browse files Browse the repository at this point in the history
merge release
  • Loading branch information
mgehre-amd authored Jun 25, 2024
2 parents 0b089c8 + 5310597 commit 3cbdae8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,13 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
rewriter.getIntegerAttr(rewriter.getIntegerType(64), 1));

auto transpose = [&](Value m) -> Value {
auto tty = m.getType().cast<Torch::ValueTensorType>();
auto shape = tty.getOptionalSizes();
auto tty = cast<Torch::ValueTensorType>(m.getType());
std::optional<ArrayRef<int64_t>> shape = tty.getOptionalSizes();
llvm::SmallVector<int64_t> newShape;
if (shape.has_value()) {
llvm::SmallVector<int64_t> newShape(shape.value());
newShape.append(shape.value().begin(), shape.value().end());
std::reverse(newShape.begin(), newShape.end());
shape = std::move(newShape);
shape = newShape;
}
auto oty = Torch::ValueTensorType::get(tty.getContext(), shape,
tty.getOptionalDtype());
Expand Down

0 comments on commit 3cbdae8

Please sign in to comment.