Skip to content

Commit e1b3e5b

Browse files
committed
Fix build failure
1 parent 52ed331 commit e1b3e5b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

include/torch-mlir/Dialect/Torch/IR/GeneratedPrimOps.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,14 @@ def Torch_PrimRaiseExceptionOp : Torch_Op<"prim.RaiseException", [
165165
AllowsTypeRefinement,
166166
HasValueSemantics
167167
]> {
168-
let summary = "Generated op for `prim::RaiseException : (str) -> ()`";
168+
let summary = "Generated op for `prim::RaiseException : (str, str?) -> ()`";
169169
let arguments = (ins
170-
Torch_StringType:$msg
170+
Torch_StringType:$msg,
171+
TorchOptionalStringType:$cls
171172
);
172173
let results = (outs
173174
);
174-
let assemblyFormat = "$msg attr-dict `:` qualified(type($msg))";
175+
let assemblyFormat = "$msg `,` $cls attr-dict `:` qualified(type($msg)) `,` qualified(type($cls))";
175176
}
176177

177178
def Torch_PrimUninitializedOp : Torch_Op<"prim.Uninitialized", [

include/torch-mlir/Dialect/Torch/IR/TorchTypes.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ def AnyTorchOptionalTensorType :
380380
def TorchOptionalIntType: OptionalOf<Torch_IntType, "Optional torch int type">;
381381
def TorchOptionalBoolType:
382382
OptionalOf<Torch_BoolType, "Optional torch bool type">;
383+
def TorchOptionalStringType:
384+
OptionalOf<Torch_StringType, "Optional torch Str type">;
383385
def TorchOptionalDeviceType:
384386
OptionalOf<Torch_DeviceType, "Optional torch device type">;
385387

python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def get_by_triple(self, key: Tuple[str, str, str]):
238238
"Device": "Torch_DeviceType",
239239
"Device?": "TorchOptionalDeviceType",
240240
"str": "Torch_StringType",
241+
"str?": "TorchOptionalStringType",
241242
"str[]": "TorchStringListType",
242243
"Dict": "Torch_DictType",
243244
"__torch__.torch.classes.quantized.LinearPackedParamsBase": "Torch_LinearParamsType",
@@ -413,7 +414,7 @@ def emit(key, **kwargs):
413414
emit("prim::min.int : (int, int) -> (int)")
414415
emit("prim::max.self_int : (int[]) -> (int)")
415416
emit("prim::max.int : (int, int) -> (int)")
416-
emit("prim::RaiseException : (str) -> ()")
417+
emit("prim::RaiseException : (str, str?) -> ()")
417418
emit("prim::Uninitialized : () -> (Any)", traits=["NoSideEffect"])
418419
emit("prim::unchecked_cast : (t) -> (t)",
419420
traits=["DeclareOpInterfaceMethods<CastOpInterface>"])

0 commit comments

Comments
 (0)