mirror of https://github.com/llvm/torch-mlir
parent
52ed3313b4
commit
e1b3e5bc92
|
@ -165,13 +165,14 @@ def Torch_PrimRaiseExceptionOp : Torch_Op<"prim.RaiseException", [
|
|||
AllowsTypeRefinement,
|
||||
HasValueSemantics
|
||||
]> {
|
||||
let summary = "Generated op for `prim::RaiseException : (str) -> ()`";
|
||||
let summary = "Generated op for `prim::RaiseException : (str, str?) -> ()`";
|
||||
let arguments = (ins
|
||||
Torch_StringType:$msg
|
||||
Torch_StringType:$msg,
|
||||
TorchOptionalStringType:$cls
|
||||
);
|
||||
let results = (outs
|
||||
);
|
||||
let assemblyFormat = "$msg attr-dict `:` qualified(type($msg))";
|
||||
let assemblyFormat = "$msg `,` $cls attr-dict `:` qualified(type($msg)) `,` qualified(type($cls))";
|
||||
}
|
||||
|
||||
def Torch_PrimUninitializedOp : Torch_Op<"prim.Uninitialized", [
|
||||
|
|
|
@ -380,6 +380,8 @@ def AnyTorchOptionalTensorType :
|
|||
def TorchOptionalIntType: OptionalOf<Torch_IntType, "Optional torch int type">;
|
||||
def TorchOptionalBoolType:
|
||||
OptionalOf<Torch_BoolType, "Optional torch bool type">;
|
||||
def TorchOptionalStringType:
|
||||
OptionalOf<Torch_StringType, "Optional torch Str type">;
|
||||
def TorchOptionalDeviceType:
|
||||
OptionalOf<Torch_DeviceType, "Optional torch device type">;
|
||||
|
||||
|
|
|
@ -238,6 +238,7 @@ TORCH_TYPE_TO_ODS_TYPE = {
|
|||
"Device": "Torch_DeviceType",
|
||||
"Device?": "TorchOptionalDeviceType",
|
||||
"str": "Torch_StringType",
|
||||
"str?": "TorchOptionalStringType",
|
||||
"str[]": "TorchStringListType",
|
||||
"Dict": "Torch_DictType",
|
||||
"__torch__.torch.classes.quantized.LinearPackedParamsBase": "Torch_LinearParamsType",
|
||||
|
@ -413,7 +414,7 @@ def emit_prim_ops(torch_ir_dir: str, registry: Registry):
|
|||
emit("prim::min.int : (int, int) -> (int)")
|
||||
emit("prim::max.self_int : (int[]) -> (int)")
|
||||
emit("prim::max.int : (int, int) -> (int)")
|
||||
emit("prim::RaiseException : (str) -> ()")
|
||||
emit("prim::RaiseException : (str, str?) -> ()")
|
||||
emit("prim::Uninitialized : () -> (Any)", traits=["NoSideEffect"])
|
||||
emit("prim::unchecked_cast : (t) -> (t)",
|
||||
traits=["DeclareOpInterfaceMethods<CastOpInterface>"])
|
||||
|
|
Loading…
Reference in New Issue