Skip to content

Commit

Permalink
Merge pull request #195 from Xilinx/tina.error-out-onnx-op-version-ty…
Browse files Browse the repository at this point in the history
…pe-mismatch

Error out if version has the wrong type
  • Loading branch information
mgehre-amd authored Jul 10, 2024
2 parents 2f137b6 + d212544 commit 66a48d6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/Conversion/TorchOnnxToTorch/Patterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ LogicalResult OnnxCustomOpConversionPattern::matchAndRewrite(
// overrides the function's domainVersion and will be used for matching later
// here.
if (auto attr = op->getAttrOfType<IntegerAttr>("torch.onnx_meta.version")) {
if (auto type = dyn_cast<IntegerType>(attr.getType())) {
if (type.isSigned()) {
opDomainVersion =
op->getAttrOfType<IntegerAttr>("torch.onnx_meta.version").getSInt();
}
}
assert(cast<IntegerType>(attr.getType()).isSigned());
opDomainVersion = attr.getSInt();
}
auto &reggies = foundIt->second;
for (const HandlerReg &reg : reggies) {
Expand Down

0 comments on commit 66a48d6

Please sign in to comment.