diff --git a/stablehlo/dialect/Base.td b/stablehlo/dialect/Base.td index f99c00eb7bb..46f681856a8 100644 --- a/stablehlo/dialect/Base.td +++ b/stablehlo/dialect/Base.td @@ -185,7 +185,7 @@ def HLO_DimensionTensor : 1DTensorOf<[HLO_DimensionValue]>; // TODO(b/326463552): Remove these when CHLO no longer needs unranked dynamism. //===----------------------------------------------------------------------===// -def HLO_AnyTensor : TensorOf<[HLO_Float, HLO_Pred, HLO_Int, HLO_Complex, HLO_QuantizedInt]>; +def HLO_AnyTensor : TensorOf<[HLO_Float, HLO_Pred, HLO_Int, HLO_Complex, HLO_QuantizedInt, HLO_PerAxisQuantizedInt]>; def HLO_AnyPredTensor : TensorOf<[HLO_Pred]>; diff --git a/stablehlo/dialect/StablehloOps.td b/stablehlo/dialect/StablehloOps.td index 0b49674fd49..c8203897343 100644 --- a/stablehlo/dialect/StablehloOps.td +++ b/stablehlo/dialect/StablehloOps.td @@ -2182,7 +2182,7 @@ def StableHLO_CustomCallOp: StableHLO_Op<"custom_call", }]; let arguments = (ins - Variadic:$inputs, + Variadic:$inputs, StrAttr:$call_target_name, DefaultValuedOptionalAttr:$has_side_effect, DefaultValuedStrAttr:$backend_config, @@ -2202,7 +2202,7 @@ def StableHLO_CustomCallOp: StableHLO_Op<"custom_call", "{}">:$output_operand_aliases ); - let results = (outs Variadic); + let results = (outs Variadic); let hasVerifier = 1; let assemblyFormat = [{ diff --git a/stablehlo/tests/ops_stablehlo.mlir b/stablehlo/tests/ops_stablehlo.mlir index c0b3642aa94..f0d857cc8bb 100644 --- a/stablehlo/tests/ops_stablehlo.mlir +++ b/stablehlo/tests/ops_stablehlo.mlir @@ -4221,6 +4221,15 @@ func.func @custom_call_output_operand_alias(%arg0: tuple, tensor // ----- +// CHECK-LABEL: func @custom_call_unranked_types +func.func @custom_call_unranked_types(%arg0: tensor<*xf32>) -> tensor<*xf32> { + // CHECK: stablehlo.custom_call {{.*}} : (tensor<*xf32>) -> tensor<*xf32> + %0 = "stablehlo.custom_call"(%arg0) {call_target_name = "foo"} : (tensor<*xf32>) -> tensor<*xf32> + func.return %0 : tensor<*xf32> +} + +// ----- + // Test custom attribute printing/parsing. // We really just need one op as holder, use module: this is the simplest top-level.