‘chlo’ Dialect

Client HLO Ops

This dialect contains ops that align closely with the API surface area of the XlaBuilder C++ API, where such ops have semantics that go beyond what exists in the lower level dialects (such as stablehlo). Essentially, whenever the client library uses syntactic sugar or composition of multiple ops for an API call, this dialect tries to model the API call and provide conversion patterns to fully materialize into lower level dialects.

Operations

chlo._asin_acos_kernel (chlo::AsinAcosKernelOp)

AsinAcosKernel operator

Syntax:

operation ::= `chlo._asin_acos_kernel` $operand attr-dict `:` type($operand) `->` type($result)

Returns AsinAcosKernel(operand) element-wise.

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))

This op is used as an intermediate value in decompositions and should never be constructed directly by frameworks or consumed by backends.

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of complex type with 32/64-bit float elements values

chlo.acos (chlo::AcosOp)

Acos operator

Syntax:

operation ::= `chlo.acos` $operand attr-dict `:` type($operand) `->` type($result)

Returns Acos(operand) element-wise.

$$ \acos(x) = 2 * \atan(\sqrt(1 - x^2) / (1 + x)) if x != -1 = pi if x == -1 $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.acosh (chlo::AcoshOp)

Acosh operation

Syntax:

operation ::= `chlo.acosh` $operand attr-dict `:` type($operand) `->` type($result)

Returns Acosh(operand) element-wise.

$$ \acosh(x) = log(x + sqrt(x^2 - 1)) if x >= -1 \acosh(x) = nan if x < -1 $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.asin (chlo::AsinOp)

Asin operator

Syntax:

operation ::= `chlo.asin` $operand attr-dict `:` type($operand) `->` type($result)

Returns Asin(operand) element-wise.

$$ \asin(x) = 2 * atan(x / (1 + sqrt(1 - x^2))) $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.asinh (chlo::AsinhOp)

Asinh operation

Syntax:

operation ::= `chlo.asinh` $operand attr-dict `:` type($operand) `->` type($result)

Returns Asinh(operand) element-wise.

$$ \asinh(x) = log(x + sqrt(x^2 + 1)) $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.atan (chlo::AtanOp)

Atan operator

Syntax:

operation ::= `chlo.atan` $operand attr-dict `:` type($operand) `->` type($result)

Returns Atan(operand) element-wise.

$$ \atan(x) = \atan2(x, 1) $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.atanh (chlo::AtanhOp)

Atanh operator

Syntax:

operation ::= `chlo.atanh` $operand attr-dict `:` type($operand) `->` type($result)

Returns Atanh(operand) element-wise.

$$ \atanh(x) = 0.5 * log((1 + x) / (1 - x)) if abs(x) <= 1 = nan otherwise $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.bessel_i1e (chlo::BesselI1eOp)

Bessel function of order 1

Syntax:

operation ::= `chlo.bessel_i1e` $operand attr-dict `:` type($operand) `->` type($result)

Returns bessel_i1e(operand) element-wise.

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.broadcast_add (chlo::BroadcastAddOp)

Addition operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_add` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs + rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, Commutative, HLO_BroadcastingElementwise, HLO_CompatibleOperandsAndResultElementType, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_and (chlo::BroadcastAndOp)

Logical and operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_and` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns logical_and(lhs, rhs) element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, Commutative, HLO_BroadcastingElementwise, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of bool or 2/4/8/16/32/64-bit integer values
rhstensor of bool or 2/4/8/16/32/64-bit integer values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_atan2 (chlo::BroadcastAtan2Op)

Atan2 operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_atan2` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns atan2(lhs/rhs) element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_compare (chlo::BroadcastCompareOp)

Compare operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_compare` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Compares lhs and rhs elementwise according to comparison_direction and compare_type. If unspecified, compare_type is FLOAT for float element types, SIGNED for signed element types and UNSIGNED for unsigned element types.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_comparison_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of bool values

chlo.broadcast_complex (chlo::BroadcastComplexOp)

Complex operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_complex` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Performs element-wise conversion of a pair of real and imaginary values to a complex value.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float values
rhstensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
«unnamed»tensor of complex type with 32/64-bit float elements values

chlo.broadcast_divide (chlo::BroadcastDivOp)

Division operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_divide` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs / rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_maximum (chlo::BroadcastMaxOp)

Maximum operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_maximum` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns max(lhs, rhs) element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, Commutative, HLO_BroadcastingElementwise, HLO_CompatibleOperandsAndResultElementType, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_minimum (chlo::BroadcastMinOp)

Minimum operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_minimum` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns min(lhs, rhs) element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, Commutative, HLO_BroadcastingElementwise, HLO_CompatibleOperandsAndResultElementType, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_multiply (chlo::BroadcastMulOp)

Multiplication operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_multiply` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs * rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, Commutative, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_next_after (chlo::BroadcastNextAfterOp)

Std::nextafter operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_next_after` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns the next representable value of lhs in the direction of rhs, element-wise. It can also return a subnormal number.

Equivalent to the C++ std::nextafter function.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_or (chlo::BroadcastOrOp)

Logical or operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_or` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns logical_or(lhs, rhs) element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, Commutative, HLO_BroadcastingElementwise, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of bool or 2/4/8/16/32/64-bit integer values
rhstensor of bool or 2/4/8/16/32/64-bit integer values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_polygamma (chlo::BroadcastPolygammaOp)

Polygamma function (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_polygamma` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns Polygamma(operand, operand) element-wise.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_power (chlo::BroadcastPowOp)

Power operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_power` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs ^ rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_remainder (chlo::BroadcastRemOp)

Remainder operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_remainder` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs % rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_select (chlo::BroadcastSelectOp)

Select operator (with optional numpy-style broadcasting)

Syntax:

operation ::= `chlo.broadcast_select` $pred `,` $on_true `,` $on_false attr-dict `:`
              `(` type($pred) `,` type($on_true) `,` type($on_false) `)` `->` type(results)

Constructs an output array from elements of two input arrays, based on the values of a predicate array.

See https://www.tensorflow.org/xla/operation_semantics#select

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
predranked tensor of bool values
on_truetensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
on_falsetensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_shift_left (chlo::BroadcastShiftLeftOp)

Shift left operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_shift_left` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs << rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_shift_right_arithmetic (chlo::BroadcastShiftRightArithmeticOp)

Shift right arithmetic operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_shift_right_arithmetic` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs >> rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_shift_right_logical (chlo::BroadcastShiftRightLogicalOp)

Shift right logical operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_shift_right_logical` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs >> rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_subtract (chlo::BroadcastSubOp)

Subtraction operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_subtract` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns lhs - rhs element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_xor (chlo::BroadcastXorOp)

Logical xor operator (with optional broadcasting)

Syntax:

operation ::= `chlo.broadcast_xor` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns logical_xor(lhs, rhs) element-wise.

See https://www.tensorflow.org/xla/operation_semantics#element-wise_binary_arithmetic_operations.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, Commutative, HLO_BroadcastingElementwise, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of bool or 2/4/8/16/32/64-bit integer values
rhstensor of bool or 2/4/8/16/32/64-bit integer values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.broadcast_zeta (chlo::BroadcastZetaOp)

Hurwitz zeta function

Syntax:

operation ::= `chlo.broadcast_zeta` $lhs `,` $rhs attr-dict `:`
              `(` type($lhs) `,` type($rhs) `)` `->` type(results)

Returns Zeta(operand, operand) element-wise.

$$ (\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}) $$

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultElementType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float values
rhstensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float values

chlo.conj (chlo::ConjOp)

Conj operator

Syntax:

operation ::= `chlo.conj` $operand attr-dict `:` type($operand) `->` type($result)

Returns Conj(operand) element-wise.

$$ \conj(x) = (\real(x), \neg(\imag(x))) $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.constant (chlo::ConstantOp)

Constant operator

Syntax:

operation ::= `chlo.constant` attr-dict $value

Represents a constant value.

Traits: AlwaysSpeculatableImplTrait, ConstantLike

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Results:

ResultDescription
outputstatically shaped tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized values

chlo.constant_like (chlo::ConstantLikeOp)

Constant like operator

Returns a splat constant of the same shape as the operand.

Traits: AlwaysSpeculatableImplTrait, CHLO_Broadcasting, HLO_BroadcastingElementwise, InferTensorType, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
«unnamed»tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.cosh (chlo::CoshOp)

Cosh operator

Syntax:

operation ::= `chlo.cosh` $operand attr-dict `:` type($operand) `->` type($result)

Returns Cosh(operand) element-wise.

$$ \cosh(x) = (e^x + e^-x) / 2 $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.digamma (chlo::DigammaOp)

Digamma function

Syntax:

operation ::= `chlo.digamma` $operand attr-dict `:` type($operand) `->` type($result)

Returns Digamma(operand) element-wise.

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

chlo.erf (chlo::ErfOp)

Erfc operator

Syntax:

operation ::= `chlo.erf` $operand attr-dict `:` type($operand) `->` type($result)

Computes the Gauss error function of x element-wise.

erf(x) = erf_impl(x) if |x| < 1 = 1 - erfc_impl(x) otherwise

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

chlo.erf_inv (chlo::ErfInvOp)

Inverse Erf

Syntax:

operation ::= `chlo.erf_inv` $operand attr-dict `:` type($operand) `->` type($result)

Returns ErfInv(operand) element-wise.

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

chlo.erfc (chlo::ErfcOp)

Erfc operator

Syntax:

operation ::= `chlo.erfc` $operand attr-dict `:` type($operand) `->` type($result)

Computes an approximation of the error function complement (1 - erf(x)).

erfc(x) = erfc_impl(x) if |x| > 1 = 1 - erf_impl(x) otherwise

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

chlo.is_inf (chlo::IsInfOp)

IsInf predicate

Syntax:

operation ::= `chlo.is_inf` $operand attr-dict `:` type($operand) `->` type($result)

Returns if a value is +/-inf element-wise.

Traits: AlwaysSpeculatableImplTrait, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of bool values

chlo.is_neg_inf (chlo::IsNegInfOp)

IsNegInf predicate

Syntax:

operation ::= `chlo.is_neg_inf` $operand attr-dict `:` type($operand) `->` type($result)

Returns if a value is -inf element-wise.

Traits: AlwaysSpeculatableImplTrait, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of bool values

chlo.is_pos_inf (chlo::IsPosInfOp)

IsPosInf predicate

Syntax:

operation ::= `chlo.is_pos_inf` $operand attr-dict `:` type($operand) `->` type($result)

Returns if a value is +inf element-wise.

Traits: AlwaysSpeculatableImplTrait, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of bool values

chlo.lgamma (chlo::LgammaOp)

Lgamma function

Syntax:

operation ::= `chlo.lgamma` $operand attr-dict `:` type($operand) `->` type($result)

Returns Lgamma(operand) element-wise.

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

chlo.mulhi (chlo::MulhiOp)

Mulhi operation

Syntax:

operation ::= `chlo.mulhi` $lhs `,` $rhs attr-dict `:` type($lhs) `,` type($rhs) `->` type($result)

Performs element-wise multiplication of two N-bit integer tensors lhs and rhs, returning a N-bit integer result tensor containing the most significant N bits of the upcasted (N+N-bit) product.

$$ \text{mulhi}(x, y) = \text{downcast}((\text{upcast}(x) * \text{upcast}(y)) >> N) $$

Traits: AlwaysSpeculatableImplTrait, Commutative, CompatibleOperandsAndResultType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
lhsranked tensor of 2/4/8/16/32/64-bit integer values
rhsranked tensor of 2/4/8/16/32/64-bit integer values

Results:

ResultDescription
resultranked tensor of 2/4/8/16/32/64-bit integer values

chlo.next_after (chlo::NextAfterOp)

Std::nextafter operator

Syntax:

operation ::= `chlo.next_after` $x `,` $y attr-dict `:` type($x) `,` type($y) `->` type(results)

Returns the next representable value of x in the direction of y, element-wise. It can also return a subnormal number.

Equivalent to the C++ std::nextafter function.

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
xtensor of 4/6/8/16/32/64-bit float values
ytensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

chlo.polygamma (chlo::PolygammaOp)

Polygamma function

Syntax:

operation ::= `chlo.polygamma` $n `,` $x attr-dict `:` type($n) `,` type($x) `->` type(results)

Returns Polygamma(operand, operand) element-wise.

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
ntensor of 4/6/8/16/32/64-bit float values
xtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

chlo.ragged_dot (chlo::RaggedDotOp)

Computes a matmul over a single ragged dimension

This operation takes three tensor args---lhs, rhs, and group_sizes---and a “ragged_dot_dimension_numbers” attribute. Like dot_general, the lhs and rhs are allowed arbitrary batch and contracting dimensions. Additionally, the lhs is required to have one ragged dimension, and the rhs may have at most one group dimension. The op has three modes, depending on the kind of the lhs ragged dimension.

In mode 1, the shape-signature is [b,m,k], [g,b,k,n], [b,g] -> [b,m,n]. Here the ragged dimension is an lhs non-contracting dimension (m). The dimensions b and k represent batch and contracting dimensions respectively. The rhs is required to have a group dimension (g).

In mode 2, the shape-signature is [b,m,k], [b,k,n], [b,g] -> [g,b,m,n]. Here the ragged dimension is an lhs/rhs contracting dimension (k).

In mode 3, the shape-signature is [b,m,k], [b,k,n], [g] -> [b,m,n]. Here the ragged dimension is an lhs/rhs batch dimension (b).

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
lhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
rhstensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
group_sizesranked tensor of 2/4/8/16/32/64-bit integer values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.scan (chlo::ScanOp)

Scan operation

Applies a reduction function body to inputs and inits along the dimension and produces results (comprising outputs and carries).

If is_reverse is true, the scan is performed in reverse order. is_associative indicates whether the reduction function is associative.

See: https://www.tensorflow.org/xla/operation_semantics#scan

ScanOp currently does not have a decomposition to StableHLO.

Traits: AttrSizedOperandSegments, AttrSizedResultSegments, InferTensorType, IsolatedFromAbove, RecursiveMemoryEffects

Interfaces: InferShapedTypeOpInterface, InferTypeOpInterface, OpAsmOpInterface

Attributes:

Operands:

OperandDescription
inputsvariadic of tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
initsvariadic of tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
outputsvariadic of tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
carriesvariadic of tensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.sinh (chlo::SinhOp)

Sinh operation

Syntax:

operation ::= `chlo.sinh` $operand attr-dict `:` type($operand) `->` type($result)

Returns Sinh(operand) element-wise.

$$ \sinh(x) = (e^x - e^-x) / 2 if |x| < 1 = e^(x + log(1/2)) - e^(-x + log(1/2)) otherwise. $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.square (chlo::SquareOp)

Square operation

Syntax:

operation ::= `chlo.square` $operand attr-dict `:` type($operand) `->` type($result)

Returns Square(operand) element-wise.

$$ \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 $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.tan (chlo::TanOp)

Tan operation

Syntax:

operation ::= `chlo.tan` $operand attr-dict `:` type($operand) `->` type($result)

Returns Tan(operand) element-wise.

$$ \tan(x) = \sin(x) / \cos(x) $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType, Elementwise, SameOperandsAndResultShape

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float or complex type with 32/64-bit float elements values

chlo.top_k (chlo::TopKOp)

Finds values and indices of the k largest elements for the last dimension

Syntax:

operation ::= `chlo.top_k` `(`$operand `,` `k` `=` $k (`,` `is_stable` `=` $is_stable^)? `)` attr-dict `:`
              type($operand) `->` `(`type($values)`,` type($indices)`)`

If the input is a vector (rank-1), finds the k largest entries in the vector and outputs their values and indices as vectors. Thus values[j] is the j-th largest entry in input, and its index is indices[j].

For matrices (resp. higher rank input), computes the top k entries in each row (resp. vector along the last dimension). Thus,

values.shape = indices.shape = input.shape[:-1] + [k]

If is_stable is true, the sort is stable: if two elements are equal, the lower-index element appears first. If false, the relative order of equal elements is implementation-defined.

Traits: AlwaysSpeculatableImplTrait, InferTensorType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

Operands:

OperandDescription
operandtensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

Results:

ResultDescription
valuestensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values
indicestensor of 4/6/8/16/32/64-bit float or bool or 2/4/8/16/32/64-bit integer or complex type with 32/64-bit float elements or per-tensor integer quantized or per-axis integer quantized values

chlo.zeta (chlo::ZetaOp)

Hurwitz zeta function

Syntax:

operation ::= `chlo.zeta` $x `,` $q attr-dict `:` type($x) `,` type($q) `->` type(results)

Returns Zeta(operand, operand) element-wise.

$$ (\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}) $$

Traits: AlwaysSpeculatableImplTrait, CompatibleOperandsAndResultType

Interfaces: ConditionallySpeculatable, InferShapedTypeOpInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
xtensor of 4/6/8/16/32/64-bit float values
qtensor of 4/6/8/16/32/64-bit float values

Results:

ResultDescription
resulttensor of 4/6/8/16/32/64-bit float values

Attributes

ComparisonDirectionAttr

Which comparison operation to perform.

Syntax:

#chlo.comparison_direction<
  `EQ` | `NE` | `GE` | `GT` | `LE` | `LT`   # value
>

Parameters:

ParameterC++ typeDescription
value::mlir::chlo::ComparisonDirectionan enum of type ComparisonDirection

ComparisonTypeAttr

Which comparison type to use.

Syntax:

#chlo.comparison_type<
  `NOTYPE` | `FLOAT` | `TOTALORDER` | `SIGNED` | `UNSIGNED`   # value
>

Parameters:

ParameterC++ typeDescription
value::mlir::chlo::ComparisonTypean enum of type ComparisonType

PrecisionAttr

XLA precision for an operand. Has backend specific meaning.

Syntax:

#chlo.precision<
  `DEFAULT` | `HIGH` | `HIGHEST`   # value
>

Parameters:

ParameterC++ typeDescription
value::mlir::chlo::Precisionan enum of type Precision

RaggedDotDimensionNumbersAttr

Attribute that models the dimension information for ragged dot.

Parameters:

ParameterC++ typeDescription
lhsBatchingDimensions::llvm::ArrayRef<int64_t>Dimension
rhsBatchingDimensions::llvm::ArrayRef<int64_t>Dimension
lhsContractingDimensions::llvm::ArrayRef<int64_t>Dimension
rhsContractingDimensions::llvm::ArrayRef<int64_t>Dimension
lhsRaggedDimensions::llvm::ArrayRef<int64_t>Dimension
rhsGroupDimensions::llvm::ArrayRef<int64_t>Dimension

Enums

ComparisonDirection

Which comparison operation to perform.

Cases:

SymbolValueString
EQ0EQ
NE1NE
GE2GE
GT3GT
LE4LE
LT5LT

ComparisonType

Which comparison type to use.

Cases:

SymbolValueString
NOTYPE0NOTYPE
FLOAT1FLOAT
TOTALORDER2TOTALORDER
SIGNED3SIGNED
UNSIGNED4UNSIGNED

Precision

XLA precision for an operand. Has backend specific meaning.

Cases:

SymbolValueString
DEFAULT0DEFAULT
HIGH1HIGH
HIGHEST2HIGHEST