Client HLO Ops
此方言包含与 XlaBuilder C++ API 的 API 表面积密切相关的操作,其中此类操作的语义超出了较低级别方言(例如 stablehlo)中的语义。从本质上讲,每当客户端库使用语法糖或多个操作的组合进行 API 调用时,此方言都会尝试对 API 调用进行建模,并提供转换模式以完全具体化为较低级别的方言。
运维
chlo._asin_acos_kernel (chlo::AsinAcosKernelOp)
AsinAcosKernel 运算符
语法:
operation ::= `chlo._asin_acos_kernel` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 AsinAcosKernel(operand)。
If
w = _asin_acos_kernel(z)
w' = _asin_acos_kernel(I * z)
Then
asin(z) = complex(atan2(z.real, w.real), sign(z.imag) * w.imag)
acos(z) = complex(atan2(w.real, z.real), -sign(z.imag) * w.imag)
asinh(z) = complex(sign(z.real) * w'.imag, atan2(z.imag, w'.real))
acosh(z) = complex(w.imag, sign(z.imag) * atan2(w.real, z.real))
此操作用作分解中的中间值,绝不应由框架直接构建或由后端使用。
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的复杂类型张量 |
chlo.acos (chlo::AcosOp)
Acos 运算符
语法:
operation ::= `chlo.acos` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Acos(operand)。
\[ \acos(x) = 2 * \atan(\sqrt(1 - x^2) / (1 + x)) if x != -1 = pi if x == -1 \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.acosh (chlo::AcoshOp)
反双曲余弦运算
语法:
operation ::= `chlo.acosh` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Acosh(operand)。
\[ \acosh(x) = log(x + sqrt(x^2 - 1)) if x >= -1 \acosh(x) = nan if x < -1 \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.asin (chlo::AsinOp)
Asin 运算符
语法:
operation ::= `chlo.asin` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Asin(operand)。
\[ \asin(x) = 2 * atan(x / (1 + sqrt(1 - x^2))) \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.asinh (chlo::AsinhOp)
Asinh 操作
语法:
operation ::= `chlo.asinh` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Asinh(operand)。
\[ \asinh(x) = log(x + sqrt(x^2 + 1)) \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.atan (chlo::AtanOp)
Atan 运算符
语法:
operation ::= `chlo.atan` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Atan(operand)。
\[ \atan(x) = \atan2(x, 1) \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.atanh (chlo::AtanhOp)
Atanh 运算符
语法:
operation ::= `chlo.atanh` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Atanh(operand)。
\[ \atanh(x) = 0.5 * log((1 + x) / (1 - x)) if abs(x) <= 1 = nan otherwise \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.bessel_i1e (chlo::BesselI1eOp)
一阶贝塞尔函数
语法:
operation ::= `chlo.bessel_i1e` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 bessel_i1e(operand)。
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.broadcast_add (chlo::BroadcastAddOp)
加法运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_add` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs + rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、Commutative、HLO_BroadcastingElementwise、HLO_CompatibleOperandsAndResultElementType、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_and (chlo::BroadcastAndOp)
逻辑 AND 运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_and` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 logical_and(lhs, rhs)。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、Commutative、HLO_BroadcastingElementwise、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
布尔值或 2/4/8/16/32/64 位整数值的张量 |
rhs |
布尔值或 2/4/8/16/32/64 位整数值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_atan2 (chlo::BroadcastAtan2Op)
Atan2 运算符(可选择广播)
语法:
operation ::= `chlo.broadcast_atan2` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 atan2(lhs/rhs)。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_compare (chlo::BroadcastCompareOp)
比较运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_compare` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
根据 comparison_direction 和 compare_type 逐元素比较 lhs 和 rhs。如果未指定,则对于浮点元素类型,compare_type 为 FLOAT;对于有符号元素类型,compare_type 为 SIGNED;对于无符号元素类型,compare_type 为 UNSIGNED。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_comparison_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
comparison_direction | ::mlir::chlo::ComparisonDirectionAttr | 要执行的比较操作。 |
compare_type | ::mlir::chlo::ComparisonTypeAttr | 要使用的比较类型。 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 布尔值张量 |
chlo.broadcast_complex (chlo::BroadcastComplexOp)
复杂运算符(具有可选的广播功能)
语法:
operation ::= `chlo.broadcast_complex` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素方式将一对实数值和虚数值转换为复数值。
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
4/6/8/16/32/64 位浮点值张量 |
rhs |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 32/64 位浮点元素值的复杂类型张量 |
chlo.broadcast_divide (chlo::BroadcastDivOp)
除法运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_divide` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs / rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_maximum (chlo::BroadcastMaxOp)
最大运算符(可选择广播)
语法:
operation ::= `chlo.broadcast_maximum` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 max(lhs, rhs)。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、Commutative、HLO_BroadcastingElementwise、HLO_CompatibleOperandsAndResultElementType、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_minimum (chlo::BroadcastMinOp)
最小运算符(可选广播)
语法:
operation ::= `chlo.broadcast_minimum` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 min(lhs, rhs)。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、Commutative、HLO_BroadcastingElementwise、HLO_CompatibleOperandsAndResultElementType、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_multiply (chlo::BroadcastMulOp)
乘法运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_multiply` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs * rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、Commutative、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_next_after (chlo::BroadcastNextAfterOp)
std::nextafter 运算符(可选广播)
语法:
operation ::= `chlo.broadcast_next_after` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
返回 lhs 在 rhs 方向上的下一个可表示值(按元素)。它还可以返回次正态数。
等效于 C++ std::nextafter 函数。
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_or (chlo::BroadcastOrOp)
逻辑或运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_or` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 logical_or(lhs, rhs)。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、Commutative、HLO_BroadcastingElementwise、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
布尔值或 2/4/8/16/32/64 位整数值的张量 |
rhs |
布尔值或 2/4/8/16/32/64 位整数值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_polygamma (chlo::BroadcastPolygammaOp)
Polygamma 函数(具有可选的广播功能)
语法:
operation ::= `chlo.broadcast_polygamma` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 Polygamma(operand, operand)。
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_power (chlo::BroadcastPowOp)
电源运算符(可选择是否广播)
语法:
operation ::= `chlo.broadcast_power` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs ^ rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_remainder (chlo::BroadcastRemOp)
求余运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_remainder` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs % rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_select (chlo::BroadcastSelectOp)
选择运算符(带有可选的 numpy 样式广播)
语法:
operation ::= `chlo.broadcast_select` $pred `,` $on_true `,` $on_false attr-dict `:`
`(` type($pred) `,` type($on_true) `,` type($on_false) `)` `->` type(results)
根据谓词数组的值,从两个输入数组的元素构造一个输出数组。
请参阅 https://www.tensorflow.org/xla/operation_semantics#select
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
pred |
布尔值排名张量 |
on_true |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
on_false |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_shift_left (chlo::BroadcastShiftLeftOp)
左移运算符(可选择广播)
语法:
operation ::= `chlo.broadcast_shift_left` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs << rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_shift_right_arithmetic (chlo::BroadcastShiftRightArithmeticOp)
右移算术运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_shift_right_arithmetic` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs >> rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_shift_right_logical (chlo::BroadcastShiftRightLogicalOp)
右移逻辑运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_shift_right_logical` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs >> rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_subtract (chlo::BroadcastSubOp)
减法运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_subtract` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 lhs - rhs。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_xor (chlo::BroadcastXorOp)
逻辑异或运算符(可选择是否进行广播)
语法:
operation ::= `chlo.broadcast_xor` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 logical_xor(lhs, rhs)。
请参阅 https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、Commutative、HLO_BroadcastingElementwise、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
布尔值或 2/4/8/16/32/64 位整数值的张量 |
rhs |
布尔值或 2/4/8/16/32/64 位整数值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.broadcast_zeta (chlo::BroadcastZetaOp)
Hurwitz zeta 函数
语法:
operation ::= `chlo.broadcast_zeta` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results)
按元素返回 Zeta(operand, operand)。
\[ \(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\) \]
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultElementType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
broadcast_dimensions | ::mlir::DenseI64ArrayAttr | i64 密集数组属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
4/6/8/16/32/64 位浮点值张量 |
rhs |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 4/6/8/16/32/64 位浮点值张量 |
chlo.conj (chlo::ConjOp)
Conj 运算符
语法:
operation ::= `chlo.conj` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Conj(operand)。
\[ \conj(x) = (\real(x), \neg(\imag(x))) \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.constant (chlo::ConstantOp)
常量运算符
语法:
operation ::= `chlo.constant` attr-dict $value
表示常量值。
特征:AlwaysSpeculatableImplTrait、ConstantLike
接口:ConditionallySpeculatable、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
value | ::mlir::ElementsAttr | 常量向量/张量属性 |
结果:
| 结果 | 说明 |
|---|---|
output |
具有 32/64 位浮点元素或每个张量整数量化值的 4/6/8/16/32/64 位浮点或布尔或 2/4/8/16/32/64 位整数或复数类型的静态形状张量 |
chlo.constant_like (chlo::ConstantLikeOp)
类似运算符的常量
返回与操作数形状相同的 splat 常量。
特征:AlwaysSpeculatableImplTrait、CHLO_Broadcasting、HLO_BroadcastingElementwise、InferTensorType、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
value | ::mlir::TypedAttr | TypedAttr 实例 |
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
| “未命名” | 具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.cosh (chlo::CoshOp)
Cosh 运算符
语法:
operation ::= `chlo.cosh` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Cosh(operand)。
\[ \cosh(x) = (e^x + e^-x) / 2 \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.digamma (chlo::DigammaOp)
双伽马函数
语法:
operation ::= `chlo.digamma` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Digamma(operand)。
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
chlo.erf (chlo::ErfOp)
Erfc 运算符
语法:
operation ::= `chlo.erf` $operand attr-dict `:` type($operand) `->` type($result)
按元素计算 x 的高斯误差函数。
erf(x) = erf_impl(x) if |x| < 1 = 1 - erfc_impl(x) otherwise
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
chlo.erf_inv (chlo::ErfInvOp)
反向 Erf
语法:
operation ::= `chlo.erf_inv` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 ErfInv(operand)。
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
chlo.erfc (chlo::ErfcOp)
Erfc 运算符
语法:
operation ::= `chlo.erfc` $operand attr-dict `:` type($operand) `->` type($result)
计算误差函数补 (1 - erf(x)) 的近似值。
erfc(x) = erfc_impl(x) if |x| > 1 = 1 - erf_impl(x) otherwise
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
chlo.is_inf (chlo::IsInfOp)
IsInf 谓词
语法:
operation ::= `chlo.is_inf` $operand attr-dict `:` type($operand) `->` type($result)
返回某个值是否为 +/-inf(按元素)。
特征:AlwaysSpeculatableImplTrait、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
布尔值张量 |
chlo.is_neg_inf (chlo::IsNegInfOp)
IsNegInf 谓词
语法:
operation ::= `chlo.is_neg_inf` $operand attr-dict `:` type($operand) `->` type($result)
返回某个值是否为 -inf(按元素)。
特征:AlwaysSpeculatableImplTrait、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
布尔值张量 |
chlo.is_pos_inf (chlo::IsPosInfOp)
IsPosInf 谓词
语法:
operation ::= `chlo.is_pos_inf` $operand attr-dict `:` type($operand) `->` type($result)
返回某个值是否为 +inf(按元素)。
特征:AlwaysSpeculatableImplTrait、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
布尔值张量 |
chlo.lgamma (chlo::LgammaOp)
Lgamma 函数
语法:
operation ::= `chlo.lgamma` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Lgamma(operand)。
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
chlo.next_after (chlo::NextAfterOp)
std::nextafter 运算符
语法:
operation ::= `chlo.next_after` $x `,` $y attr-dict `:` type($x) `,` type($y) `->` type(results)
返回 x 在 y 方向上的下一个可表示值(按元素)。它还可以返回次正态数。
等效于 C++ std::nextafter 函数。
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
x |
4/6/8/16/32/64 位浮点值张量 |
y |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
chlo.polygamma (chlo::PolygammaOp)
Polygamma 函数
语法:
operation ::= `chlo.polygamma` $n `,` $x attr-dict `:` type($n) `,` type($x) `->` type(results)
按元素返回 Polygamma(operand, operand)。
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
n |
4/6/8/16/32/64 位浮点值张量 |
x |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
chlo.ragged_dot (chlo::RaggedDotOp)
计算单个不规则维度的 matmul
此操作接受三个张量实参(lhs、rhs 和 group_sizes)以及一个“ragged_dot_dimension_numbers”属性。与 dot_general 类似,lhs 和 rhs 允许任意批次维度和收缩维度。此外,lhs 必须具有一个不规则维度,而 rhs 最多可以具有一个分组维度。该运算有三种模式,具体取决于左侧不规则维度的类型。
在模式 1 中,形状签名是 [b,m,k], [g,b,k,n], [b,g] -> [b,m,n]。
在此示例中,不规则维度是左侧非收缩维度 (m)。维度 b 和 k 分别表示批次维度和收缩维度。右侧必须具有分组维度 (g)。
在模式 2 中,形状签名是 [b,m,k], [b,k,n], [b,g] -> [g,b,m,n]。
在此示例中,不规则维度是左侧/右侧收缩维度 (k)。
在模式 3 中,形状签名是 [b,m,k], [b,k,n], [g] -> [b,m,n]。在此示例中,不规则维度是左侧/右侧批次维度 (b)。
特征:AlwaysSpeculatableImplTrait
接口:ConditionallySpeculatable、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
ragged_dot_dimension_numbers | ::mlir::chlo::RaggedDotDimensionNumbersAttr | 用于为不规则点建模维度信息的属性。 |
precision_config | ::mlir::ArrayAttr | Precision Config 属性 |
操作数:
| Operand | 说明 |
|---|---|
lhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
rhs |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
group_sizes |
包含 2/4/8/16/32/64 位整数值的秩为 1 的张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.scan (chlo::ScanOp)
扫描操作
沿 dimension 对 inputs 和 inits 应用归约函数 body,并生成 results(包含 outputs 和 carries)。
如果 is_reverse 为 true,则按相反顺序执行扫描。
is_associative 表示归约函数是否具有关联性。
请参阅:https://www.tensorflow.org/xla/operation_semantics#scan
ScanOp 目前没有分解为 StableHLO。
特征:AttrSizedOperandSegments、AttrSizedResultSegments、InferTensorType、IsolatedFromAbove、RecursiveMemoryEffects
接口:InferShapedTypeOpInterface、InferTypeOpInterface、OpAsmOpInterface
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
dimension | ::mlir::IntegerAttr | 值是非负值的 64 位无符号整数属性 |
is_reverse | ::mlir::BoolAttr | 布尔值属性 |
is_associative | ::mlir::BoolAttr | 布尔值属性 |
操作数:
| Operand | 说明 |
|---|---|
inputs |
4/6/8/16/32/64 位浮点数或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点数元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量的可变实参 |
inits |
4/6/8/16/32/64 位浮点数或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点数元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量的可变实参 |
结果:
| 结果 | 说明 |
|---|---|
outputs |
4/6/8/16/32/64 位浮点数或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点数元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量的可变实参 |
carries |
4/6/8/16/32/64 位浮点数或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点数元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量的可变实参 |
chlo.sinh (chlo::SinhOp)
Sinh 操作
语法:
operation ::= `chlo.sinh` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Sinh(operand)。
\[ \sinh(x) = (e^x - e^-x) / 2 if |x| < 1 = e^(x + log(1/2)) - e^(-x + log(1/2)) otherwise. \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.square (chlo::SquareOp)
平方运算
语法:
operation ::= `chlo.square` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Square(operand)。
\[ \square(x) = complex((x.real - x.imag) * (x.real + x.imag), x.real * x.imag * 2) if x is a complex number = x * x otherwise \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.tan (chlo::TanOp)
Tan 操作
语法:
operation ::= `chlo.tan` $operand attr-dict `:` type($operand) `->` type($result)
按元素返回 Tan(operand)。
\[ \tan(x) = \sin(x) / \cos(x) \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType、Elementwise、SameOperandsAndResultShape
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
具有 32/64 位浮点元素值的 4/6/8/16/32/64 位浮点或复杂类型张量 |
chlo.top_k (chlo::TopKOp)
查找最后一个维度中 k 个最大元素的值和索引
语法:
operation ::= `chlo.top_k` `(`$operand `,` `k` `=` $k`)` attr-dict `:`
type($operand) `->` `(`type($values)`,` type($indices)`)`
如果输入是向量(秩为 1),则找到向量中最大的 k 个条目,并以向量形式输出它们的值和索引。因此,values[j] 是 input 中第 j 大的条目,其指数为 indices[j]。
对于矩阵(或更高秩的输入),计算每个行(或沿最后一个维度的向量)中的前 k 个条目。因此,
values.shape = indices.shape = input.shape[:-1] + [k]
如果两个元素相等,则索引较低的元素会先显示。
特征:AlwaysSpeculatableImplTrait、InferTensorType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
属性:
| 属性 | MLIR 类型 | 说明 |
|---|---|---|
k | ::mlir::IntegerAttr | 64 位无符号整数属性 |
操作数:
| Operand | 说明 |
|---|---|
operand |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
结果:
| 结果 | 说明 |
|---|---|
values |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
indices |
具有 4/6/8/16/32/64 位浮点或布尔值或 2/4/8/16/32/64 位整数或具有 32/64 位浮点元素的复数类型或每个张量整数量化值或每个轴整数量化值的张量 |
chlo.zeta (chlo::ZetaOp)
Hurwitz zeta 函数
语法:
operation ::= `chlo.zeta` $x `,` $q attr-dict `:` type($x) `,` type($q) `->` type(results)
按元素返回 Zeta(operand, operand)。
\[ \(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\) \]
特征:AlwaysSpeculatableImplTrait、CompatibleOperandsAndResultType
接口:ConditionallySpeculatable、InferShapedTypeOpInterface、InferTypeOpInterface、NoMemoryEffect (MemoryEffectOpInterface)
效果:MemoryEffects::Effect{}
操作数:
| Operand | 说明 |
|---|---|
x |
4/6/8/16/32/64 位浮点值张量 |
q |
4/6/8/16/32/64 位浮点值张量 |
结果:
| 结果 | 说明 |
|---|---|
result |
4/6/8/16/32/64 位浮点值张量 |
属性
ComparisonDirectionAttr
要执行的比较操作。
语法:
#chlo.comparison_direction<
::mlir::chlo::ComparisonDirection # value
>
参数:
| 参数 | C++ 类型 | 说明 |
|---|---|---|
| 值 | ::mlir::chlo::ComparisonDirection |
ComparisonDirection 类型的枚举 |
ComparisonTypeAttr
要使用的比较类型。
语法:
#chlo.comparison_type<
::mlir::chlo::ComparisonType # value
>
参数:
| 参数 | C++ 类型 | 说明 |
|---|---|---|
| 值 | ::mlir::chlo::ComparisonType |
ComparisonType 类型的枚举 |
PrecisionAttr
操作数的 XLA 精确度。具有后端特定含义。
语法:
#chlo.precision<
::mlir::chlo::Precision # value
>
参数:
| 参数 | C++ 类型 | 说明 |
|---|---|---|
| 值 | ::mlir::chlo::Precision |
Precision 类型的枚举 |
RaggedDotDimensionNumbersAttr
用于为不规则点建模维度信息的属性。
参数:
| 参数 | C++ 类型 | 说明 |
|---|---|---|
| lhsBatchingDimensions | ::llvm::ArrayRef<int64_t> |
维度 |
| rhsBatchingDimensions | ::llvm::ArrayRef<int64_t> |
维度 |
| lhsContractingDimensions | ::llvm::ArrayRef<int64_t> |
维度 |
| rhsContractingDimensions | ::llvm::ArrayRef<int64_t> |
维度 |
| lhsRaggedDimensions | ::llvm::ArrayRef<int64_t> |
维度 |
| rhsGroupDimensions | ::llvm::ArrayRef<int64_t> |
维度 |
枚举
ComparisonDirection
要执行的比较操作。
支持请求:
| 符号 | 值 | 字符串 |
|---|---|---|
| 均衡器 | 0 |
均衡器 |
| 东北 | 1 |
东北 |
| GE | 2 |
GE |
| GT | 3 |
GT |
| LE | 4 |
LE |
| LT | 5 |
LT |
ComparisonType
要使用的比较类型。
支持请求:
| 符号 | 值 | 字符串 |
|---|---|---|
| NOTYPE | 0 |
NOTYPE |
| FLOAT | 1 |
FLOAT |
| TOTALORDER | 2 |
TOTALORDER |
| SIGNED | 3 |
SIGNED |
| UNSIGNED | 4 |
UNSIGNED |
精确率
操作数的 XLA 精确度。具有后端特定含义。
支持请求:
| 符号 | 值 | 字符串 |
|---|---|---|
| 默认 | 0 |
默认 |
| 高 | 1 |
高 |
| 最高 | 2 |
最高 |