use super::{
OpAttributeKind, OpAttributeSpec, OpControlFlow, OpDTypeRule, OpDifferentiation, OpEffect,
OpFusionClass, OpLowering, OpShapeRule, OpValueKind, OperationContract,
};
pub mod matrix {
use super::*;
pub const ADD: OperationContract = OperationContract::new(
"oa::FnMatrix::add",
0x0a2a862200859b54,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BIAS_ADD: OperationContract = OperationContract::new(
"oa::FnMatrix::biasAdd",
0x19dd09a568e168cc,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SUB: OperationContract = OperationContract::new(
"oa::FnMatrix::sub",
0x30324ed8c778da9e,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MUL: OperationContract = OperationContract::new(
"oa::FnMatrix::mul",
0xb7c7db3780c88252,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const DIV: OperationContract = OperationContract::new(
"oa::FnMatrix::div",
0xd3d40d61745e20e9,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SCALE: OperationContract = OperationContract::new(
"oa::FnMatrix::scale",
0x3fa3800cff89b8ea,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const NEG: OperationContract = OperationContract::new(
"oa::FnMatrix::neg",
0x35103edbf22d60f2,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const ABS: OperationContract = OperationContract::new(
"oa::FnMatrix::abs",
0xc4fa5c4cc4fdca10,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const LOG: OperationContract = OperationContract::new(
"oa::FnMatrix::log",
0x2c29315db02e4cd2,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SQRT: OperationContract = OperationContract::new(
"oa::FnMatrix::sqrt",
0x8e0ca16ed81704ac,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const POW: OperationContract = OperationContract::new(
"oa::matrix::pow",
0xfc6355438069359c,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("exponent", OpAttributeKind::Float)]);
pub const ADD_SCALAR: OperationContract = OperationContract::new(
"oa::FnMatrix::addScalar",
0x3e273ec838e21451,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const SUB_SCALAR: OperationContract = OperationContract::new(
"oa::FnMatrix::subScalar",
0x3fd8f52f2ac369ae,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const DIV_SCALAR: OperationContract = OperationContract::new(
"oa::FnMatrix::divScalar",
0xc9501da52366c0f5,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const EXP: OperationContract = OperationContract::new(
"oa::FnMatrix::exp",
0xe857df35113590b9,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SIN: OperationContract = OperationContract::new(
"oa::matrix::sin",
0x2ff28b5ff7466c66,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const COS: OperationContract = OperationContract::new(
"oa::matrix::cos",
0x3196fbecedf6a717,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const RECIPROCAL: OperationContract = OperationContract::new(
"oa::FnMatrix::reciprocal",
0xac25fcc8aed83a0e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CLAMP_MAX: OperationContract = OperationContract::new(
"oa::FnMatrix::clampMax",
0x8536e231bc0298eb,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("max", OpAttributeKind::Float)]);
pub const CLAMP_MIN: OperationContract = OperationContract::new(
"oa::FnMatrix::clampMin",
0x8ee7ee97147e942b,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("min", OpAttributeKind::Float)]);
pub const COPY: OperationContract = OperationContract::new(
"oa::FnMatrix::copy",
0x90d68f7b3504b5bd,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MAT_MUL_NT: OperationContract = OperationContract::new(
"oa::FnMatrix::matMulNt",
0x4309b836dbcb8f84,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatMulNt)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Gemm)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SOFTMAX: OperationContract = OperationContract::new(
"oa::FnMatrix::softmax",
0xb86716c0d18620df,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const SOFTMAX_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::softmax_backward",
0xda501396094472c2,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const LOG_SOFTMAX: OperationContract = OperationContract::new(
"oa::FnMatrix::logSoftmax",
0x838e7642cbc653c5,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const LOG_SOFTMAX_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::log_softmax_backward",
0xa2f65f366bdea2d7,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const SUM: OperationContract = OperationContract::new(
"oa::FnMatrix::sum",
0xb1a79b6637053642,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const SUM_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::sum_backward",
0xc7c56a841d7c029f,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const MEAN: OperationContract = OperationContract::new(
"oa::FnMatrix::mean",
0x2c20cf9ff9387418,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const MAX: OperationContract = OperationContract::new(
"oa::FnMatrix::max",
0xe07ea6a22cf81aa2,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MAX_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::max_backward",
0xc2c8d0406cf945ea,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const ARGMAX: OperationContract = OperationContract::new(
"oa::matrix::argmax",
0xf6d1cba4fd4071ec,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CATEGORICAL_ACCURACY_COUNT: OperationContract = OperationContract::new(
"oa::FnMatrix::categoricalAccuracyCount",
0xa0781bc439f628a8,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MASKED_CATEGORICAL_ACCURACY_COUNT: OperationContract = OperationContract::new(
"oa::FnMatrix::maskedCategoricalAccuracyCount",
0x39b31bd27e4dce1d,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const PHILOX_UNIFORM: OperationContract = OperationContract::new(
"oa::FnMatrix::philoxUniform",
0x0248c53d3ec118f4,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("low", OpAttributeKind::Float),
OpAttributeSpec::new("high", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const PHILOX_NORMAL: OperationContract = OperationContract::new(
"oa::FnMatrix::philoxNormal",
0x0366c23d9029ef65,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mean", OpAttributeKind::Float),
OpAttributeSpec::new("stddev", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const PHILOX_REPLAY_ADVANCE: OperationContract = OperationContract::new(
"oa::matrix::philox_replay_advance",
0x16e0d26cc7f2a978,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.mutated_inputs(0x01)
.alias(0, 0);
pub const DROPOUT: OperationContract = OperationContract::new(
"oa::FnMatrix::dropout",
0x3958102eb380e479,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("probability", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const DROPOUT_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::dropout_backward",
0xd8672f9ed03c2c9c,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("probability", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const SAMPLE_LOGITS: OperationContract = OperationContract::new(
"oa::FnMatrix::sampleLogits",
0x3bbc4f6f7f2ffa8d,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("temperature", OpAttributeKind::Float),
OpAttributeSpec::new("topK", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("topP", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const TOP_K: OperationContract = OperationContract::new(
"oa::FnMatrix::topK",
0x93793e21044736a8,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("k", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger),
]);
pub const TOP_K_MASK: OperationContract = OperationContract::new(
"oa::FnMatrix::topKMask",
0xc3326e70e602bec6,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"numExperts",
OpAttributeKind::SignedInteger,
)]);
pub const MOE_EXPERT_PLAN: OperationContract = OperationContract::new(
"oa::FnMatrix::moeExpertPlan",
0x91e036e9fc58329e,
&[OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"numExperts",
OpAttributeKind::SignedInteger,
)]);
pub const MOE_ROUTING_BIAS_UPDATE: OperationContract = OperationContract::new(
"oa::matrix::moe_routing_bias_update",
0x12dc72174a36cc86,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("experts_per_token", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("gamma", OpAttributeKind::Float),
])
.mutated_inputs(0x02)
.alias(0, 1);
pub const SLICE: OperationContract = OperationContract::new(
"oa::FnMatrix::slice",
0x7d2d4f73f42bda65,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("start", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("end", OpAttributeKind::SignedInteger),
]);
pub const SLICE_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::slice_backward",
0x899e93a893422910,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("input_shape", OpAttributeKind::Shape),
OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("start", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("end", OpAttributeKind::SignedInteger),
]);
pub const REPEAT_INTERLEAVE: OperationContract = OperationContract::new(
"oa::FnMatrix::repeatInterleave",
0x38ff9eff40739b27,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("repeats", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger),
]);
pub const REPEAT_INTERLEAVE_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::repeat_interleave_backward",
0x4e22e67d4018f048,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("input_shape", OpAttributeKind::Shape),
OpAttributeSpec::new("repeats", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger),
]);
pub const GATHER: OperationContract = OperationContract::new(
"oa::FnMatrix::gather",
0xa57c49c29d5a76ea,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GATHER_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::gather_backward",
0x5eeb74cc99a0c248,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("input_shape", OpAttributeKind::Shape)]);
pub const GATHER_LAST_DIM: OperationContract = OperationContract::new(
"oa::FnMatrix::gatherLastDim",
0x842ae739cff848e7,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GATHER_LAST_DIM_BACKWARD: OperationContract = OperationContract::new(
"oa::matrix::gather_last_dim_backward",
0x88e091196ef1c67f,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"input_width",
OpAttributeKind::SignedInteger,
)]);
pub const CONCAT: OperationContract = OperationContract::new(
"oa::FnMatrix::concat",
0xbe61d4c206671ab2,
&[],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const TRANSPOSE: OperationContract = OperationContract::new(
"oa::FnMatrix::transpose",
0xebc1236cc3148055,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("dim0", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("dim1", OpAttributeKind::SignedInteger),
]);
pub const EQUAL: OperationContract = OperationContract::new(
"oa::FnMatrix::equal",
0x56cec835fafe3bbc,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("value", OpAttributeKind::Float)]);
pub const CAUSAL_MASK: OperationContract = OperationContract::new(
"oa::FnMatrix::causalMask",
0x0288e2fe1c3d6f7b,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Attention)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CAUSAL_MASK_BACKWARD: OperationContract = OperationContract::new(
"oa::FnMatrix::causalMaskBwd",
0x9dd451de17799ce9,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Attention)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GREATER_EQUAL: OperationContract = OperationContract::new(
"oa::FnMatrix::greaterEqual",
0xdaf5db72737d2c48,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("value", OpAttributeKind::Float)]);
pub const SPLIT: OperationContract = OperationContract::new(
"oa::FnMatrix::split",
0x2018054bb5b3d8e2,
&[OpValueKind::Matrix],
&[],
)
.variadic_outputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const COMPACT_ROWS: OperationContract = OperationContract::new(
"oa::FnMatrix::compactRows",
0xeee49eb4d585f2b0,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const COMPACT_ROWS_BACKWARD: OperationContract = OperationContract::new(
"oa::FnMatrix::compactRowsBwd",
0xe92c574212f13ff0,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[OpAttributeSpec::new("inputShape", OpAttributeKind::Shape)])
.optional_inputs(0x08);
pub const SCATTER_ROWS: OperationContract = OperationContract::new(
"oa::FnMatrix::scatterRows",
0x3728208e79db6edc,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.optional_inputs(0x10);
pub const SCATTER_ROWS_BACKWARD_SOURCE: OperationContract = OperationContract::new(
"oa::FnMatrix::scatterRowsBwdSource",
0x4a3f4202abc8226c,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.optional_inputs(0x08);
}
pub mod ml {
use super::*;
pub const PPO_CLIPPED_POLICY: OperationContract = OperationContract::new(
"oa::FnLoss::ppoClippedPolicy",
0x78e8055ee5d49508,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("clipEpsilon", OpAttributeKind::Float)]);
pub const PPO_CLIPPED_POLICY_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::loss::ppo_clipped_policy_backward",
0xc006aad6cf7d1203,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("clip_epsilon", OpAttributeKind::Float)]);
pub const LINEAR: OperationContract = OperationContract::new(
"oa::FnMatrix::linear",
0x8c33809a0e55807d,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Gemm)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.optional_inputs(0x04);
pub const LINEAR_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::linear_backward",
0x68c46e426d56785c,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const LINEAR_PARAMETER_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::linear_parameter_backward",
0xfb4acaa7b9c18818,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CROSS_ENTROPY: OperationContract = OperationContract::new(
"oa::FnLoss::crossEntropy",
0xa04a65e53238b471,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::PromoteFloat)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CROSS_ENTROPY_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::loss::cross_entropy_backward",
0x2de515dc32a7fdc4,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MASKED_CROSS_ENTROPY: OperationContract = OperationContract::new(
"oa::FnLoss::maskedCrossEntropy",
0x1ad7ae89fcbd6bed,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"validCount",
OpAttributeKind::SignedInteger,
)]);
pub const MASKED_CROSS_ENTROPY_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::loss::masked_cross_entropy_backward",
0x839076ab7eb44e64,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"valid_count",
OpAttributeKind::SignedInteger,
)]);
pub const SMOOTH_L1: OperationContract = OperationContract::new(
"oa::FnLoss::smoothL1",
0x56ccb90430e222b5,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SMOOTH_L1_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::loss::smooth_l1_backward",
0xa1d3c9ca79d2e7f1,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MSE: OperationContract = OperationContract::new(
"oa::FnLoss::mse",
0x3625518b38867a7d,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MSE_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::loss::mse_backward",
0x71002c6dbc659be1,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const L1: OperationContract = OperationContract::new(
"oa::FnLoss::l1",
0x97d1e71dd255b22b,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const L1_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::loss::l1_backward",
0x7fd6b462f62ff52c,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BCE: OperationContract = OperationContract::new(
"oa::FnLoss::bce",
0x0e39027101da1c42,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BCE_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::loss::bce_backward",
0x00dbf8de4c541c46,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SGD: OperationContract = OperationContract::new(
"oa::ml::optim::sgd",
0x744d119d59f06680,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("learning_rate", OpAttributeKind::Float),
OpAttributeSpec::new("weight_decay", OpAttributeKind::Float),
])
.mutated_inputs(0x01)
.alias(0, 0);
pub const CLIP_GRAD_NORM: OperationContract = OperationContract::new(
"oa::ml::optim::clip_grad_norm",
0x7058f3f2b1c2e4d7,
&[],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.variadic_outputs(OpValueKind::Matrix, 1)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("max_norm", OpAttributeKind::Float)]);
pub const SGD_MOMENTUM: OperationContract = OperationContract::new(
"oa::ml::optim::sgd_momentum",
0x8b1f27ad74ae2780,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("learning_rate", OpAttributeKind::Float),
OpAttributeSpec::new("momentum", OpAttributeKind::Float),
OpAttributeSpec::new("weight_decay", OpAttributeKind::Float),
])
.mutated_inputs(0x05)
.alias(0, 0)
.alias(1, 2);
pub const ADAM: OperationContract = OperationContract::new(
"oa::ml::optim::adam",
0x04dd9ffeca937f61,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("step", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("learning_rate", OpAttributeKind::Float),
OpAttributeSpec::new("beta1", OpAttributeKind::Float),
OpAttributeSpec::new("beta2", OpAttributeKind::Float),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
])
.mutated_inputs(0x0d)
.alias(0, 0)
.alias(1, 2)
.alias(2, 3);
pub const MUON: OperationContract = OperationContract::new(
"oa::ml::optim::muon",
0x5488c11dff7f689c,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("learning_rate", OpAttributeKind::Float),
OpAttributeSpec::new("beta", OpAttributeKind::Float),
OpAttributeSpec::new("weight_decay", OpAttributeKind::Float),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
OpAttributeSpec::new("ns5_iterations", OpAttributeKind::UnsignedInteger),
])
.mutated_inputs(0x05)
.alias(0, 0)
.alias(1, 2);
pub const ADAMW: OperationContract = OperationContract::new(
"oa::ml::optim::adamw",
0x12bb830b532ec935,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("step", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("learning_rate", OpAttributeKind::Float),
OpAttributeSpec::new("beta1", OpAttributeKind::Float),
OpAttributeSpec::new("beta2", OpAttributeKind::Float),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
OpAttributeSpec::new("weight_decay", OpAttributeKind::Float),
])
.mutated_inputs(0x0d)
.alias(0, 0)
.alias(1, 2)
.alias(2, 3);
pub const ADAMW_GRAPH_ADVANCE: OperationContract = OperationContract::new(
"oa::ml::optim::adamw_graph_advance",
0x703e26fce7552b88,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.mutated_inputs(0x01)
.alias(0, 0);
pub const ADAMW_GRAPH: OperationContract = OperationContract::new(
"oa::ml::optim::adamw_graph",
0xa3c9ccbb3ad37339,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.mutated_inputs(0x0d)
.alias(0, 0)
.alias(1, 2)
.alias(2, 3);
pub const EMBEDDING: OperationContract = OperationContract::new(
"oa::ml::matrix::embedding",
0xc9619082560f2159,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const EMBEDDING_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::embedding_backward",
0x6ea2b965ff29b962,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CHANNEL_NORM: OperationContract = OperationContract::new(
"oa::FnMatrix::channelNorm",
0x4ffae2632e359b91,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("channels", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("sequenceLength", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("eps", OpAttributeKind::Float),
]);
pub const CHANNEL_NORM_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::channel_norm_backward",
0x05718ab0c40354e2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("channels", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("sequence_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
]);
pub const CHANNEL_NORM_RELU: OperationContract = OperationContract::new(
"oa::FnMatrix::channelNormRelu",
0xcb42799d33c4fa6b,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("channels", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("sequenceLength", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("eps", OpAttributeKind::Float),
]);
pub const CHANNEL_NORM_RELU_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::channel_norm_relu_backward",
0x1b963b9ffb53f168,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("channels", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("sequence_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
]);
pub const RNN_SCAN: OperationContract = OperationContract::new(
"oa::FnMatrix::rnnScan",
0x6bcab5aa32da6246,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Scan)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Loop)
.attributes(&[
OpAttributeSpec::new("hiddenSize", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("sequenceLength", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("batch", OpAttributeKind::SignedInteger),
])
.optional_inputs(0x04);
pub const RNN_SCAN_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::rnn_scan_backward",
0x42548b61390cb410,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Scan)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
pub const LAYER_NORM: OperationContract = OperationContract::new(
"oa::ml::matrix::layer_norm",
0x8deb325bf9bacb79,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const LAYER_NORM_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::layer_norm_backward",
0xf64771f99130f9c9,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const RMS_NORM: OperationContract = OperationContract::new(
"oa::FnMatrix::rmsNorm",
0xee3af65769d3ee97,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("eps", OpAttributeKind::Float)]);
pub const RMS_NORM_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::rms_norm_backward",
0xe04da914d0e53361,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const GELU: OperationContract = OperationContract::new(
"oa::FnMatrix::gelu",
0x418ae43f0776531b,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GELU_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::gelu_backward",
0x4269e8b8b6083f3a,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SILU: OperationContract = OperationContract::new(
"oa::FnMatrix::silu",
0xc1cd373b504abcc3,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SILU_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::silu_backward",
0xe10ef969604619a0,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const RELU: OperationContract = OperationContract::new(
"oa::FnMatrix::relu",
0xaacb073a9ba2e2a8,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const RELU_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::relu_backward",
0x3e6b8c194ecade60,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const TANH: OperationContract = OperationContract::new(
"oa::FnMatrix::tanh",
0xd2f0fb456ef45ba1,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const TANH_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::tanh_backward",
0x7c28513e3ebfa672,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SIGMOID: OperationContract = OperationContract::new(
"oa::FnMatrix::sigmoid",
0xa907ab10b1dee770,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SIGMOID_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::sigmoid_backward",
0x6732d8591ce3d774,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const LEAKY_RELU: OperationContract = OperationContract::new(
"oa::FnMatrix::leakyRelu",
0x1cb6137e01a98888,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const LEAKY_RELU_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::leaky_relu_backward",
0xe53727ca92a7bcda,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const ELU: OperationContract = OperationContract::new(
"oa::FnMatrix::elu",
0xc396b3608776e278,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const ELU_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::elu_backward",
0xc11dbf4e537a42da,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const MISH: OperationContract = OperationContract::new(
"oa::FnMatrix::mish",
0xa9d72471a5bb7599,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MISH_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::mish_backward",
0xfdf4f4a53158620e,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SOFTPLUS: OperationContract = OperationContract::new(
"oa::FnMatrix::softplus",
0xd7a3e9ca147510fe,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SOFTPLUS_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::softplus_backward",
0xba345c3922bc168e,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SWIGLU: OperationContract = OperationContract::new(
"oa::FnMatrix::swiglu",
0x8a39189dd0a79977,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SWIGLU_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::swiglu_backward",
0x914a5cbf8e9199b5,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const ROPE: OperationContract = OperationContract::new(
"oa::ml::matrix::rope",
0x4dcf7e4b2ece0d62,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("num_heads", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("head_dim", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("theta_base", OpAttributeKind::Float),
OpAttributeSpec::new("position_offset", OpAttributeKind::UnsignedInteger),
]);
pub const ROPE_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::rope_backward",
0x92eb12a8af0fc9b4,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("num_heads", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("head_dim", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("theta_base", OpAttributeKind::Float),
OpAttributeSpec::new("position_offset", OpAttributeKind::UnsignedInteger),
]);
pub const AVG_POOL_2D: OperationContract = OperationContract::new(
"oa::ml::matrix::avg_pool_2d",
0xf0cd090d0a7e6d36,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
]);
pub const AVG_POOL_2D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::avg_pool_2d_backward",
0x5977c65cdaaa7150,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
]);
pub const MAX_POOL_2D: OperationContract = OperationContract::new(
"oa::ml::matrix::max_pool_2d",
0x5fc9c7ccd348432a,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
]);
pub const MAX_POOL_2D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::max_pool_2d_backward",
0x08d90e244a5c42e5,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
]);
pub const ADAPTIVE_AVG_POOL_2D: OperationContract = OperationContract::new(
"oa::ml::matrix::adaptive_avg_pool_2d",
0x96b0b5e79bb4df1e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("output_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("output_width", OpAttributeKind::UnsignedInteger),
]);
pub const ADAPTIVE_AVG_POOL_2D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::adaptive_avg_pool_2d_backward",
0x03fd7fe6954c7ada,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("output_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("output_width", OpAttributeKind::UnsignedInteger),
]);
pub const BATCH_NORM_2D: OperationContract = OperationContract::new(
"oa::ml::matrix::batch_norm_2d",
0xda7b505171725de3,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const BATCH_NORM_2D_WITH_STATS: OperationContract = OperationContract::new(
"oa::ml::matrix::batch_norm_2d_with_stats",
0x5868a1ecb156adac,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const BATCH_NORM_2D_RUNNING_UPDATE: OperationContract = OperationContract::new(
"oa::ml::matrix::batch_norm_2d_running_update",
0x507aad3cd923170d,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("momentum", OpAttributeKind::Float)]);
pub const BATCH_NORM_2D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::batch_norm_2d_backward",
0x0d0f006b2bf76f6a,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
OpAttributeSpec::new("training", OpAttributeKind::Boolean),
]);
pub const UPSAMPLE_2D: OperationContract = OperationContract::new(
"oa::ml::matrix::upsample_2d",
0x5921a1fd8d291a1e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("scale_factor", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
]);
pub const UPSAMPLE_2D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::upsample_2d_backward",
0xee9107e6d0741d99,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("scale_factor", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
]);
pub const CONV_2D: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_2d",
0x657d482964539a5f,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("groups", OpAttributeKind::UnsignedInteger),
]);
pub const CONV_2D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_2d_backward",
0xf9a1b2db7fa48013,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("groups", OpAttributeKind::UnsignedInteger),
]);
pub const CONV_1D: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_1d",
0xd14897b9f7d9fffb,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("dilation", OpAttributeKind::UnsignedInteger),
]);
pub const CONV_1D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_1d_backward",
0x478827640411c41e,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("dilation", OpAttributeKind::UnsignedInteger),
]);
pub const CONV_TRANSPOSE_1D: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_transpose_1d",
0x35d6d97e23774f59,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("dilation", OpAttributeKind::UnsignedInteger),
]);
pub const CONV_TRANSPOSE_1D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_transpose_1d_backward",
0x36061ba519023ec2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("dilation", OpAttributeKind::UnsignedInteger),
]);
pub const CONV_TRANSPOSE_2D: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_transpose_2d",
0xff236e3fead0dee4,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
]);
pub const CONV_TRANSPOSE_2D_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::conv_transpose_2d_backward",
0x89b9da6e3c21389d,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("stride", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("padding", OpAttributeKind::UnsignedInteger),
]);
pub const GRU_SCAN: OperationContract = OperationContract::new(
"oa::FnMatrix::gruScan",
0x63fd6abff46c0072,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Scan)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Loop)
.attributes(&[
OpAttributeSpec::new("hiddenSize", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("sequenceLength", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("batch", OpAttributeKind::SignedInteger),
])
.optional_inputs(0x04);
pub const GRU_SCAN_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::gru_scan_backward",
0x5281c3b2a5df5375,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Scan)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
pub const GRU_CELL: OperationContract = OperationContract::new(
"oa::ml::matrix::gru_cell",
0x447099094fc64867,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
pub const GRU_CELL_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::gru_cell_backward",
0x5caef52540e95f25,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
pub const RNN_CELL: OperationContract = OperationContract::new(
"oa::ml::matrix::rnn_cell",
0xa7b9340299dfbea5,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
pub const RNN_CELL_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::rnn_cell_backward",
0xbb93fa788b7dc987,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
pub const BMM: OperationContract = OperationContract::new(
"oa::FnMatrix::bmm",
0xf560e4c2eb795506,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BMM_NT: OperationContract = OperationContract::new(
"oa::FnMatrix::bmmNt",
0x9faf9bc9d43b2e74,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BMM_TN: OperationContract = OperationContract::new(
"oa::FnMatrix::bmmTn",
0x0794cd39f84ef6dc,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SPLIT_HEADS: OperationContract = OperationContract::new(
"oa::FnMatrix::splitHeads",
0x0cc0ff381c3662b6,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("sequenceLength", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("headCount", OpAttributeKind::SignedInteger),
]);
pub const MERGE_HEADS: OperationContract = OperationContract::new(
"oa::FnMatrix::mergeHeads",
0xdc638cbb4461bffe,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("sequenceLength", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("headCount", OpAttributeKind::SignedInteger),
]);
pub const SOFTMAX_SCALED_MASKED: OperationContract = OperationContract::new(
"oa::FnMatrix::softmaxScaledMasked",
0x653e363956fa9068,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[OpAttributeSpec::new("scale", OpAttributeKind::Float)]);
pub const SOFTMAX_SCALED_MASKED_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::softmax_scaled_masked_backward",
0xe0483c8e01b05a8a,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scale", OpAttributeKind::Float)]);
pub const SCALED_DOT_PRODUCT_ATTENTION: OperationContract = OperationContract::new(
"oa::FnMatrix::scaledDotProductAttention",
0xbfb2e7fd9e051d43,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Attention)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("scale", OpAttributeKind::Float),
OpAttributeSpec::new("causal", OpAttributeKind::Boolean),
])
.optional_inputs(0x08);
pub const SCALED_DOT_PRODUCT_ATTENTION_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::scaled_dot_product_attention_backward",
0x8370e3e24615406b,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Attention)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("scale", OpAttributeKind::Float),
OpAttributeSpec::new("causal", OpAttributeKind::Boolean),
])
.optional_inputs(0x08);
pub const MOE_ROUTE_WEIGHTS: OperationContract = OperationContract::new(
"oa::FnMatrix::moeRouteWeights",
0xa3c52d79ee9ae4ad,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MOE_ROUTE_WEIGHTS_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::moe_route_weights_backward",
0x4e8d99c38a6c9d46,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MOE_GATHER: OperationContract = OperationContract::new(
"oa::FnMatrix::moeGather",
0x93965accc5735e08,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MOE_GATHER_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::moe_gather_backward",
0x12c983a1948d19cc,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_rows",
OpAttributeKind::SignedInteger,
)]);
pub const MOE_COMBINE: OperationContract = OperationContract::new(
"oa::FnMatrix::moeCombine",
0x7a67fc99b9305ad3,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MOE_COMBINE_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::moe_combine_backward",
0xfe09fec67063bc67,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GROUPED_LINEAR_M: OperationContract = OperationContract::new(
"oa::FnMatrix::groupedLinearM",
0x7cf759c33fb999da,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GROUPED_LINEAR_M_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::grouped_linear_m_backward",
0xc9d890787409e70e,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SILU_MUL: OperationContract = OperationContract::new(
"oa::ml::matrix::silu_mul",
0xa2d6269a319aaf85,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"intermediate_size",
OpAttributeKind::SignedInteger,
)]);
pub const SILU_MUL_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::silu_mul_backward",
0xac564f63aa9aa767,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"intermediate_size",
OpAttributeKind::SignedInteger,
)]);
pub const GROUPED_GEMM_M: OperationContract = OperationContract::new(
"oa::FnMatrix::groupedGemmM",
0x41bf1a8777791aa4,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GROUPED_GEMM_M_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::grouped_gemm_m_backward",
0x332edc72cfc82196,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const LINEAR_MATCH: OperationContract = OperationContract::new(
"oa::FnFlow::linearMatch",
0xcfe4ec732dcdbc85,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const EULER_STEP: OperationContract = OperationContract::new(
"oa::FnFlow::eulerStep",
0x2bbebf2f4a7c59ed,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("deltaTime", OpAttributeKind::Float)]);
pub const MASKED_MSE: OperationContract = OperationContract::new(
"oa::FnFlow::maskedMse",
0xcf731247fdf59482,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MASKED_MSE_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::flow::masked_mse_backward",
0xc5ad3a3e72fd782c,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GAE: OperationContract = OperationContract::new(
"oa::FnAdvantage::gae",
0x836ee6d423f8c9b2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("gamma", OpAttributeKind::Float),
OpAttributeSpec::new("lambda", OpAttributeKind::Float),
]);
pub const APPEND: OperationContract = OperationContract::new(
"oa::ml::rollout::append",
0x79be05efa39b93b5,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 9)
.variadic_outputs(OpValueKind::Matrix, 9)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("step", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("environments", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("observation_elements", OpAttributeKind::UnsignedInteger),
]);
pub const RESET: OperationContract = OperationContract::new(
"oa::ml::rollout::reset",
0xbe7d229361f79ac8,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.mutated_inputs(0x01)
.alias(0, 0);
pub const APPEND_BATCH: OperationContract = OperationContract::new(
"oa::ml::replay::append_batch",
0x3db1826c907bcb40,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 6)
.variadic_outputs(OpValueKind::Matrix, 6)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("cursor", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("capacity", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("batch", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("observation_elements", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("action_elements", OpAttributeKind::UnsignedInteger),
]);
pub const SAMPLE: OperationContract = OperationContract::new(
"oa::ml::replay::sample",
0x86a7ff2dd37d229e,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("batch", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("observation_elements", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("action_elements", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const RMS_NORM_GATED: OperationContract = OperationContract::new(
"oa::FnMatrix::rmsNormGated",
0xa1f7075db6d90d1a,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("eps", OpAttributeKind::Float),
OpAttributeSpec::new("normBeforeGate", OpAttributeKind::Boolean),
])
.optional_inputs(0x04);
pub const RMS_NORM_GATED_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::rms_norm_gated_backward",
0x35c5925d8b0ce817,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean),
])
.optional_inputs(0x04);
pub const MAMBA3_PREPROCESS: OperationContract = OperationContract::new(
"oa::FnMatrix::mamba3Preprocess",
0x384b61c4a5e048d4,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"configIdentity",
OpAttributeKind::UnsignedInteger,
)]);
pub const MAMBA3_PREPROCESS_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::mamba3_preprocess_backward",
0xa2b7a378c3b11aa7,
&[],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 10)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
OpAttributeKind::UnsignedInteger,
)]);
pub const MAMBA3_SISO: OperationContract = OperationContract::new(
"oa::FnMatrix::mamba3Siso",
0xf14385c4eabea494,
&[],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 11)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[OpAttributeSpec::new(
"configIdentity",
OpAttributeKind::UnsignedInteger,
)]);
pub const MAMBA3_SISO_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::mamba3_siso_backward",
0xbd83e82c011d84ef,
&[],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 12)
.variadic_outputs(OpValueKind::Matrix, 11)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
OpAttributeKind::UnsignedInteger,
)]);
pub const MAMBA3_SISO_STEP: OperationContract = OperationContract::new(
"oa::ml::matrix::mamba3_siso_step",
0xe5a24724274f2f42,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.variadic_inputs(OpValueKind::Matrix, 11)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
OpAttributeKind::UnsignedInteger,
)])
.mutated_inputs(0x0f)
.alias(1, 0)
.alias(2, 1)
.alias(3, 2)
.alias(4, 3);
pub const MAMBA3_MIMO: OperationContract = OperationContract::new(
"oa::FnMatrix::mamba3Mimo",
0xae1302f7b6d827b6,
&[],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 15)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"configIdentity",
OpAttributeKind::UnsignedInteger,
)]);
pub const MAMBA3_MIMO_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::mamba3_mimo_backward",
0xe66da138080f8bfe,
&[],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 16)
.variadic_outputs(OpValueKind::Matrix, 15)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
OpAttributeKind::UnsignedInteger,
)]);
pub const MAMBA3_MIMO_STEP: OperationContract = OperationContract::new(
"oa::ml::matrix::mamba3_mimo_step",
0x849b464e8a372cb7,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.variadic_inputs(OpValueKind::Matrix, 15)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
OpAttributeKind::UnsignedInteger,
)])
.mutated_inputs(0x0f)
.alias(1, 0)
.alias(2, 1)
.alias(3, 2)
.alias(4, 3);
pub const VQ_ASSIGN: OperationContract = OperationContract::new(
"oa::FnMatrix::vqAssign",
0x4ab4980dab05e5b9,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const VQ_LOOKUP: OperationContract = OperationContract::new(
"oa::ml::matrix::vq_lookup",
0x9fb232c3a2b947f9,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const VQ_EMA_UPDATE: OperationContract = OperationContract::new(
"oa::ml::matrix::vq_ema_update",
0x957de7392cad618e,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("decay", OpAttributeKind::Float),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
OpAttributeSpec::new("dead_threshold", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("normalize", OpAttributeKind::Boolean),
]);
pub const TRADING_RESET: OperationContract = OperationContract::new(
"oa::ml::environment::trading_reset",
0x989639196949a1c2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 4)
.variadic_outputs(OpValueKind::Matrix, 4)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("config_identity", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("only_completed", OpAttributeKind::Boolean),
]);
pub const TRADING_STEP: OperationContract = OperationContract::new(
"oa::ml::environment::trading_step",
0x7c21a1ba60a64390,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 7)
.variadic_outputs(OpValueKind::Matrix, 7)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("config_identity", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("force_end", OpAttributeKind::Boolean),
]);
pub const CAUSAL_LINEAR_ATTENTION: OperationContract = OperationContract::new(
"oa::ml::matrix::causal_linear_attention",
0x40652f68c3ea5653,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Attention)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const CAUSAL_LINEAR_ATTENTION_BACKWARD: OperationContract = OperationContract::new(
"oa::ml::matrix::causal_linear_attention_backward",
0x8e0e5c33a56b6aad,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Attention)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const MINIBATCH: OperationContract = OperationContract::new(
"oa::ml::rollout::minibatch",
0x5a68fc67c2b5bc55,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("start", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("count", OpAttributeKind::UnsignedInteger),
]);
pub const MINIBATCH_CURSOR: OperationContract = OperationContract::new(
"oa::ml::rollout::minibatch_cursor",
0xbdde7490a36a910a,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"count",
OpAttributeKind::UnsignedInteger,
)]);
pub const TRAINING_ACCUMULATE: OperationContract = OperationContract::new(
"oa::ml::matrix::training_accumulate",
0x01aea39bc0e0f0e2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scale", OpAttributeKind::Float)])
.mutated_inputs(0x01)
.alias(0, 0);
pub const APPEND_CURSOR: OperationContract = OperationContract::new(
"oa::ml::rollout::append_cursor",
0x1f3e438dd0b38d79,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 10)
.variadic_outputs(OpValueKind::Matrix, 10)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("step", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("environments", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("observation_elements", OpAttributeKind::UnsignedInteger),
]);
pub const TRADING_RESET_CURSOR: OperationContract = OperationContract::new(
"oa::ml::environment::trading_reset_cursor",
0xb171900e6be59576,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 4)
.variadic_outputs(OpValueKind::Matrix, 4)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("config_identity", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("only_completed", OpAttributeKind::Boolean),
]);
pub const TRADING_STEP_CURSOR: OperationContract = OperationContract::new(
"oa::ml::environment::trading_step_cursor",
0x6d475955ce85b623,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 7)
.variadic_outputs(OpValueKind::Matrix, 7)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
OpAttributeKind::UnsignedInteger,
)]);
pub const SAMPLE_CATEGORICAL_CURSOR: OperationContract = OperationContract::new(
"oa::ml::matrix::sample_categorical_cursor",
0x0f0da87ec6f7e144,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const TRADING_CURSOR_ADVANCE: OperationContract = OperationContract::new(
"oa::ml::environment::trading_cursor_advance",
0x204693981baccc4b,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("horizon", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("continuing", OpAttributeKind::Boolean),
])
.mutated_inputs(0x01)
.alias(0, 0);
pub const NEXT_OBSERVATION_APPEND: OperationContract = OperationContract::new(
"oa::ml::rollout::next_observation_append",
0xb3b9ea167442e58d,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("step", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("observation_count", OpAttributeKind::UnsignedInteger),
])
.mutated_inputs(0x01)
.alias(0, 0);
pub const COMPUTE_SCALE_Q4: OperationContract = OperationContract::new(
"oa::FnMatrix::computeScaleQ4",
0xf729f31cacf6baa3,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const QUANTIZE_Q4: OperationContract = OperationContract::new(
"oa::FnMatrix::quantizeQ4",
0x99a1eb781a46a7f9,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const DEQUANTIZE_Q4: OperationContract = OperationContract::new(
"oa::ml::matrix::dequantize_q4",
0x3ac07b4466a5d23c,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const COMPUTE_SCALE_Q8: OperationContract = OperationContract::new(
"oa::FnMatrix::computeScaleQ8",
0xc1b4b88e68cc179f,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const QUANTIZE_Q8: OperationContract = OperationContract::new(
"oa::FnMatrix::quantizeQ8",
0x9f6b0f8c95650dc5,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const DEQUANTIZE_Q8: OperationContract = OperationContract::new(
"oa::ml::matrix::dequantize_q8",
0x5be77741a373d1e7,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MAT_MUL_NT_Q4: OperationContract = OperationContract::new(
"oa::ml::matrix::mat_mul_nt_q4",
0x248882c837fbb863,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MAT_MUL_NT_Q8: OperationContract = OperationContract::new(
"oa::ml::matrix::mat_mul_nt_q8",
0xe29dbc2d1cf01dde,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gemm)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const NORMALIZE_OBSERVATION: OperationContract = OperationContract::new(
"oa::FnEnvironment::normalizeObservation",
0xc852f265d7ab215e,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
OpAttributeSpec::new("clip", OpAttributeKind::Float),
]);
pub const SCALE_ACTION: OperationContract = OperationContract::new(
"oa::FnEnvironment::scaleAction",
0x5f16164045761764,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("sourceMinimum", OpAttributeKind::Float),
OpAttributeSpec::new("sourceMaximum", OpAttributeKind::Float),
OpAttributeSpec::new("targetMinimum", OpAttributeKind::Float),
OpAttributeSpec::new("targetMaximum", OpAttributeKind::Float),
OpAttributeSpec::new("clamp", OpAttributeKind::Boolean),
]);
pub const CLIP_REWARD: OperationContract = OperationContract::new(
"oa::FnEnvironment::clipReward",
0x1687c940a3f83351,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("minimum", OpAttributeKind::Float),
OpAttributeSpec::new("maximum", OpAttributeKind::Float),
]);
pub const NORMALIZE: OperationContract = OperationContract::new(
"oa::FnAdvantage::normalize",
0x30b63bd0b398e59f,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const PPO: OperationContract = OperationContract::new(
"oa::FnLoss::ppo",
0xcb94e587a2d545d5,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("clipEpsilon", OpAttributeKind::Float),
OpAttributeSpec::new("valueCoefficient", OpAttributeKind::Float),
OpAttributeSpec::new("entropyCoefficient", OpAttributeKind::Float),
]);
pub const DQN: OperationContract = OperationContract::new(
"oa::FnLoss::dqn",
0x4f8b3117cac95c49,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("discount", OpAttributeKind::Float)]);
pub const SAC_CRITIC: OperationContract = OperationContract::new(
"oa::FnLoss::sacCritic",
0xeca089d97df6b3aa,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("discount", OpAttributeKind::Float),
OpAttributeSpec::new("entropyCoefficient", OpAttributeKind::Float),
]);
pub const SAC_ACTOR: OperationContract = OperationContract::new(
"oa::FnLoss::sacActor",
0x4b3c11aa36173394,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"entropyCoefficient",
OpAttributeKind::Float,
)]);
pub const SAMPLE_CATEGORICAL: OperationContract = OperationContract::new(
"oa::FnPolicy::sampleCategorical",
0x20eafc0202fd9d2a,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"seed",
OpAttributeKind::UnsignedInteger,
)])
.alias(3, 1);
pub const EVALUATE_CATEGORICAL: OperationContract = OperationContract::new(
"oa::FnPolicy::evaluateCategorical",
0x6e7a487c46f3cce6,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.alias(0, 1)
.alias(3, 2);
pub const SAMPLE_TANH_NORMAL: OperationContract = OperationContract::new(
"oa::FnPolicy::sampleTanhNormal",
0x66874b2a4f85e53c,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("minimum", OpAttributeKind::Float),
OpAttributeSpec::new("maximum", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
])
.alias(4, 2);
pub const EVALUATE_TANH_NORMAL: OperationContract = OperationContract::new(
"oa::FnPolicy::evaluateTanhNormal",
0x3579ae127f8758e8,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("minimum", OpAttributeKind::Float),
OpAttributeSpec::new("maximum", OpAttributeKind::Float),
OpAttributeSpec::new("epsilon", OpAttributeKind::Float),
])
.alias(1, 2)
.alias(4, 3);
pub const QUANTIZE: OperationContract = OperationContract::new(
"oa::FnMatrix::quantize",
0x2c2075ebb3df2391,
&[OpValueKind::Matrix],
&[OpValueKind::QuantMatrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[OpAttributeSpec::new("quantization", OpAttributeKind::Enum)]);
pub const DEQUANTIZE: OperationContract = OperationContract::new(
"oa::FnMatrix::dequantize",
0x265692803d596359,
&[OpValueKind::QuantMatrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[OpAttributeSpec::new("quantization", OpAttributeKind::Enum)]);
pub const MAT_MUL_NT_QUANTIZED: OperationContract = OperationContract::new(
"oa::FnMatrix::matMulNtQuantized",
0x5d0edf95db46aa53,
&[OpValueKind::Matrix, OpValueKind::QuantMatrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatMulNt)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Opaque)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[OpAttributeSpec::new("quantization", OpAttributeKind::Enum)]);
}
pub mod audio {
use super::*;
pub const NORMALIZE: OperationContract = OperationContract::new(
"oa::FnAudio::normalize",
0x30b364147b54c946,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("targetDb", OpAttributeKind::Float),
OpAttributeSpec::new("mode", OpAttributeKind::UnsignedInteger),
]);
pub const RESAMPLE: OperationContract = OperationContract::new(
"oa::FnAudio::resample",
0xf0ebfe5b70df774a,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("outRate", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("filterHalfWidth", OpAttributeKind::UnsignedInteger),
]);
pub const GAIN: OperationContract = OperationContract::new(
"oa::FnAudio::gain",
0x6d4e321743df9305,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("gainDb", OpAttributeKind::Float)]);
pub const CLIP: OperationContract = OperationContract::new(
"oa::FnAudio::clip",
0x2dfa67eb7d61140a,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("min", OpAttributeKind::Float),
OpAttributeSpec::new("max", OpAttributeKind::Float),
]);
pub const SATURATE: OperationContract = OperationContract::new(
"oa::FnAudio::saturate",
0xe598248ac65c32c5,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("driveDb", OpAttributeKind::Float),
OpAttributeSpec::new("mix", OpAttributeKind::Float),
]);
pub const BIQUAD: OperationContract = OperationContract::new(
"oa::FnAudio::biquad",
0x23fd6d9e94c95487,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Scan)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("b0", OpAttributeKind::Float),
OpAttributeSpec::new("b1", OpAttributeKind::Float),
OpAttributeSpec::new("b2", OpAttributeKind::Float),
OpAttributeSpec::new("a1", OpAttributeKind::Float),
OpAttributeSpec::new("a2", OpAttributeKind::Float),
]);
pub const REVERB: OperationContract = OperationContract::new(
"oa::FnAudio::reverb",
0xcc6a9fdc21b539fb,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("decaySeconds", OpAttributeKind::Float),
OpAttributeSpec::new("wet", OpAttributeKind::Float),
]);
pub const SOS_FILTER: OperationContract = OperationContract::new(
"oa::FnAudio::sosFilter",
0x23be119427a61f79,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Scan)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("sectionCount", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("coefficientHash", OpAttributeKind::UnsignedInteger),
]);
pub const PRE_EMPHASIS: OperationContract = OperationContract::new(
"oa::FnAudio::preEmphasis",
0x5dbc1e205f05bf1c,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const TO_MONO: OperationContract = OperationContract::new(
"oa::FnAudio::toMono",
0x53dfa71239b47ce0,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const FADE: OperationContract = OperationContract::new(
"oa::FnAudio::fade",
0x529b3b27f5964679,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fadeInSamples", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("fadeOutSamples", OpAttributeKind::UnsignedInteger),
]);
pub const MIX: OperationContract = OperationContract::new(
"oa::FnAudio::mix",
0xe0dc93d833b2fefe,
&[OpValueKind::Audio, OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("gainA", OpAttributeKind::Float),
OpAttributeSpec::new("gainB", OpAttributeKind::Float),
]);
pub const AMPLITUDE_TO_DB: OperationContract = OperationContract::new(
"oa::FnAudio::amplitudeToDb",
0x6915266b03878965,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("floorDb", OpAttributeKind::Float)]);
pub const WAVEFORM_ENVELOPE: OperationContract = OperationContract::new(
"oa::FnAudio::waveformEnvelope",
0x1396920e96be303b,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"bins",
OpAttributeKind::UnsignedInteger,
)]);
pub const STFT: OperationContract = OperationContract::new(
"oa::FnAudio::stft",
0x5b3d5e57c8c64cfa,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fftSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hopSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("winSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("window", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("center", OpAttributeKind::Boolean),
]);
pub const STFT_COMPLEX: OperationContract = OperationContract::new(
"oa::audio::stft_complex",
0x48b250bc5761b8fe,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fftSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hopSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("winSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("window", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("center", OpAttributeKind::Boolean),
]);
pub const ISTFT: OperationContract = OperationContract::new(
"oa::audio::istft",
0x101dd193d1458452,
&[OpValueKind::Matrix],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fftSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hopSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("winSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("window", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("center", OpAttributeKind::Boolean),
]);
pub const MEL_SPECTROGRAM: OperationContract = OperationContract::new(
"oa::FnAudio::melSpectrogram",
0xf629d11d0b35e9bb,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fftSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hopSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("numMels", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("fMin", OpAttributeKind::Float),
OpAttributeSpec::new("fMax", OpAttributeKind::Float),
OpAttributeSpec::new("logScale", OpAttributeKind::Boolean),
OpAttributeSpec::new("normalize", OpAttributeKind::Boolean),
]);
pub const MFCC: OperationContract = OperationContract::new(
"oa::FnAudio::mfcc",
0xdb0047ed6a8efa1f,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("numCoeffs", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("fftSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hopSize", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("numMels", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("fMin", OpAttributeKind::Float),
OpAttributeSpec::new("fMax", OpAttributeKind::Float),
OpAttributeSpec::new("logScale", OpAttributeKind::Boolean),
OpAttributeSpec::new("normalize", OpAttributeKind::Boolean),
]);
}
pub mod crypto {
use super::*;
pub mod hash {
use super::*;
pub const SHAKE128: OperationContract = OperationContract::new(
"oa::FnHash::shake128",
0xbd9efbc7ff544223,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"outputLength",
OpAttributeKind::UnsignedInteger,
)]);
pub const SHAKE256: OperationContract = OperationContract::new(
"oa::FnHash::shake256",
0x500f43f9653f5459,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"outputLength",
OpAttributeKind::UnsignedInteger,
)]);
pub const KECCAK_F1600: OperationContract = OperationContract::new(
"oa::FnHash::keccakF1600",
0x01141f39576e17bc,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MERKLE_ROOT: OperationContract = OperationContract::new(
"oa::FnHash::merkleRoot",
0xc92e4bfbdbcc4d22,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Loop);
pub const SHA224: OperationContract = OperationContract::new(
"oa::crypto::hash::sha224",
0xa9edb01257e6d4ac,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA256: OperationContract = OperationContract::new(
"oa::crypto::hash::sha256",
0x0b065b9dfe33b5fd,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA384: OperationContract = OperationContract::new(
"oa::crypto::hash::sha384",
0xac557ed2ef16871d,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA512: OperationContract = OperationContract::new(
"oa::crypto::hash::sha512",
0x1614e98a0a709ca9,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA512_224: OperationContract = OperationContract::new(
"oa::crypto::hash::sha512_224",
0x84b37ac2a2e70731,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA512_256: OperationContract = OperationContract::new(
"oa::crypto::hash::sha512_256",
0xd944530da015695a,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA3_224: OperationContract = OperationContract::new(
"oa::crypto::hash::sha3_224",
0x5720a5baae1f5a8b,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA3_256: OperationContract = OperationContract::new(
"oa::crypto::hash::sha3_256",
0x76d9a0e7c6e27ed7,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA3_384: OperationContract = OperationContract::new(
"oa::crypto::hash::sha3_384",
0x6852d648a8c2d8e7,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SHA3_512: OperationContract = OperationContract::new(
"oa::crypto::hash::sha3_512",
0x9811a20e3396bdce,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MERKLE_PROOFS: OperationContract = OperationContract::new(
"oa::crypto::hash::merkle_proofs",
0xb6411e72954d6e16,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const VERIFY_MERKLE_PROOFS: OperationContract = OperationContract::new(
"oa::crypto::hash::verify_merkle_proofs",
0x6245685dcf163ed2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"leaf_count",
OpAttributeKind::UnsignedInteger,
)]);
pub const POSEIDON2_BABYBEAR16: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_babybear16",
0xe278ade953a849dc,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_length",
OpAttributeKind::UnsignedInteger,
)]);
pub const POSEIDON2_BABYBEAR16_PERMUTE: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_babybear16_permute",
0xd3967922b0b9c95a,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const POSEIDON2_BABYBEAR24: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_babybear24",
0x11db3c7a2eb7f83a,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_length",
OpAttributeKind::UnsignedInteger,
)]);
pub const POSEIDON2_BABYBEAR24_PERMUTE: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_babybear24_permute",
0x1499b286dd3e28fc,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const POSEIDON2_KOALABEAR16: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_koalabear16",
0xd389f2479e2f6651,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_length",
OpAttributeKind::UnsignedInteger,
)]);
pub const POSEIDON2_KOALABEAR16_PERMUTE: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_koalabear16_permute",
0x60d44c7387ebf75d,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const POSEIDON2_KOALABEAR24: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_koalabear24",
0x6268c99ce8f6d2c7,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_length",
OpAttributeKind::UnsignedInteger,
)]);
pub const POSEIDON2_KOALABEAR24_PERMUTE: OperationContract = OperationContract::new(
"oa::crypto::hash::poseidon2_koalabear24_permute",
0xabdec67e0639c7dd,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
}
pub mod bigint {
use super::*;
pub const ADD: OperationContract = OperationContract::new(
"oa::crypto::bigint::add",
0xe45af01ff46862ec,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const SUBTRACT: OperationContract = OperationContract::new(
"oa::crypto::bigint::subtract",
0xd458c0ec04031dad,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const MULTIPLY_LOW: OperationContract = OperationContract::new(
"oa::crypto::bigint::multiply_low",
0xaa153c3d7072673c,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const MULTIPLY_WIDE: OperationContract = OperationContract::new(
"oa::crypto::bigint::multiply_wide",
0xbf3d81cec8af9834,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const BIT_AND: OperationContract = OperationContract::new(
"oa::crypto::bigint::bit_and",
0xdc040b36ff910780,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const BIT_OR: OperationContract = OperationContract::new(
"oa::crypto::bigint::bit_or",
0xba087fa880caa672,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const BIT_XOR: OperationContract = OperationContract::new(
"oa::crypto::bigint::bit_xor",
0xe88edde571b8e35f,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const COMPARE: OperationContract = OperationContract::new(
"oa::crypto::bigint::compare",
0x5e02665ada69cbad,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const DIV_REM: OperationContract = OperationContract::new(
"oa::crypto::bigint::div_rem",
0x258cba987c4ae606,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const SHIFT_LEFT: OperationContract = OperationContract::new(
"oa::crypto::bigint::shift_left",
0xb7e6415c9d31f366,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("shift", OpAttributeKind::UnsignedInteger),
]);
pub const SHIFT_RIGHT: OperationContract = OperationContract::new(
"oa::crypto::bigint::shift_right",
0x4871217499b9dafb,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("shift", OpAttributeKind::UnsignedInteger),
]);
pub const REDUCE_MOD: OperationContract = OperationContract::new(
"oa::crypto::bigint::reduce_mod",
0xfa1930c6591f7d83,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const ADD_MOD: OperationContract = OperationContract::new(
"oa::crypto::bigint::add_mod",
0xf5124902d1b60cb8,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const SUBTRACT_MOD: OperationContract = OperationContract::new(
"oa::crypto::bigint::subtract_mod",
0xa2c2b1f12182c9b2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const MULTIPLY_MOD: OperationContract = OperationContract::new(
"oa::crypto::bigint::multiply_mod",
0x521494ebd3bed0f6,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const SQUARE_MOD: OperationContract = OperationContract::new(
"oa::crypto::bigint::square_mod",
0x18b05d4301761449,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const INVERSE_MOD: OperationContract = OperationContract::new(
"oa::crypto::bigint::inverse_mod",
0x59d63e5bedb1c89f,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const POW_MOD: OperationContract = OperationContract::new(
"oa::crypto::bigint::pow_mod",
0xb742ef6a6374b9e2,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const TO_MONTGOMERY: OperationContract = OperationContract::new(
"oa::crypto::bigint::to_montgomery",
0x79c81dd634540088,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const FROM_MONTGOMERY: OperationContract = OperationContract::new(
"oa::crypto::bigint::from_montgomery",
0x06df1bed0e96f370,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const MONTGOMERY_MULTIPLY: OperationContract = OperationContract::new(
"oa::crypto::bigint::montgomery_multiply",
0x9147709fc8002281,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const BARRETT_MULTIPLY: OperationContract = OperationContract::new(
"oa::crypto::bigint::barrett_multiply",
0x5e38b25955739e89,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const MULTIPLY_HIGH: OperationContract = OperationContract::new(
"oa::crypto::bigint::multiply_high",
0x1618a6e51a322025,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const SQUARE_WIDE: OperationContract = OperationContract::new(
"oa::crypto::bigint::square_wide",
0x1a738fe2f9317a41,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const BIT_NOT: OperationContract = OperationContract::new(
"oa::crypto::bigint::bit_not",
0x6634eca83863bb53,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const LEADING_ZEROS: OperationContract = OperationContract::new(
"oa::crypto::bigint::leading_zeros",
0xd250b4aff6506484,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const ADD_SCALAR: OperationContract = OperationContract::new(
"oa::crypto::bigint::add_scalar",
0x3c732afcbc35d007,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("scalar", OpAttributeKind::UnsignedInteger),
]);
pub const COMPARE_SCALAR: OperationContract = OperationContract::new(
"oa::crypto::bigint::compare_scalar",
0x70ed90573e5ad882,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("scalar", OpAttributeKind::UnsignedInteger),
]);
pub const DIV_REM_MIXED: OperationContract = OperationContract::new(
"oa::crypto::bigint::div_rem_mixed",
0x62d14712e381e542,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("quotient_words", OpAttributeKind::UnsignedInteger),
]);
pub const DIV_REM_NARROW: OperationContract = OperationContract::new(
"oa::crypto::bigint::div_rem_narrow",
0x0e0499d436e666e6,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const DIV_REM_SCALAR: OperationContract = OperationContract::new(
"oa::crypto::bigint::div_rem_scalar",
0x6b5295ef89611354,
&[OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("scalar", OpAttributeKind::UnsignedInteger),
]);
pub const DIV_REM_WIDE: OperationContract = OperationContract::new(
"oa::crypto::bigint::div_rem_wide",
0x9581d4ea9aae4e1b,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const FROM_U32: OperationContract = OperationContract::new(
"oa::crypto::bigint::from_u32",
0xe0e5102c5407582e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("output_words", OpAttributeKind::UnsignedInteger),
]);
pub const FROM_U64: OperationContract = OperationContract::new(
"oa::crypto::bigint::from_u64",
0x11efb26f6525436c,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("output_words", OpAttributeKind::UnsignedInteger),
]);
pub const MULTIPLY_SCALAR: OperationContract = OperationContract::new(
"oa::crypto::bigint::multiply_scalar",
0xb9084e26678935a6,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("scalar", OpAttributeKind::UnsignedInteger),
]);
pub const REDUCE_MONTGOMERY: OperationContract = OperationContract::new(
"oa::crypto::bigint::reduce_montgomery",
0xe3d4000caeb79627,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const SUBTRACT_SCALAR: OperationContract = OperationContract::new(
"oa::crypto::bigint::subtract_scalar",
0x94e4db62d8c56151,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width_bits", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("scalar", OpAttributeKind::UnsignedInteger),
]);
pub const TO_U32: OperationContract = OperationContract::new(
"oa::crypto::bigint::to_u32",
0xc86dd9722a0d5c3b,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const TO_U64: OperationContract = OperationContract::new(
"oa::crypto::bigint::to_u64",
0xc5736bd1271cf355,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const SETUP_BARRETT: OperationContract = OperationContract::new(
"oa::crypto::bigint::setup_barrett",
0x06db47a02ca29f20,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
pub const REDUCE_BARRETT: OperationContract = OperationContract::new(
"oa::crypto::bigint::reduce_barrett",
0x8e5e124b3cd08744,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"width_bits",
OpAttributeKind::UnsignedInteger,
)]);
}
pub mod ntt {
use super::*;
pub const NTT_TWIDDLES: OperationContract = OperationContract::new(
"oa::crypto::ntt::ntt_twiddles",
0x913b786a86988b4c,
&[],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("modulus", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("length", OpAttributeKind::UnsignedInteger),
]);
pub const NTT_REORDER: OperationContract = OperationContract::new(
"oa::crypto::ntt::ntt_reorder",
0xda48f9b39a4db871,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("modulus", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("montgomery", OpAttributeKind::UnsignedInteger),
]);
pub const NTT_STAGE: OperationContract = OperationContract::new(
"oa::crypto::ntt::ntt_stage",
0xbc80857e94eced3b,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("modulus", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("span", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("inverse", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("montgomery", OpAttributeKind::UnsignedInteger),
]);
pub const NTT_POINTWISE: OperationContract = OperationContract::new(
"oa::crypto::ntt::ntt_pointwise",
0x61a17c32454270bc,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("modulus", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("montgomery", OpAttributeKind::UnsignedInteger),
]);
pub const NTT_TRANSFORM: OperationContract = OperationContract::new(
"oa::crypto::ntt::ntt_transform",
0x42043a7e7b805b45,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("modulus", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("inverse", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("montgomery", OpAttributeKind::UnsignedInteger),
]);
pub const NTT_STAGE_FUSED: OperationContract = OperationContract::new(
"oa::crypto::ntt::ntt_stage_fused",
0x32123dddccba2f79,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("modulus", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("inverse", OpAttributeKind::UnsignedInteger),
]);
}
pub mod merkle {
use super::*;
pub const MERKLE_TREE_REDUCE: OperationContract = OperationContract::new(
"oa::crypto::merkle::merkle_tree_reduce",
0x31bc16b150cfdf10,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("leaf_count", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const MERKLE_FRAME_INIT: OperationContract = OperationContract::new(
"oa::crypto::merkle::merkle_frame_init",
0xc6301d252d67b32e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("leaf_count", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const MERKLE_FRAME_APPEND: OperationContract = OperationContract::new(
"oa::crypto::merkle::merkle_frame_append",
0x6fff156c86d51779,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("leaf_count", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("level", OpAttributeKind::UnsignedInteger),
])
.mutated_inputs(0x04)
.alias(0, 2);
pub const MERKLE_FRAME_VERIFY: OperationContract = OperationContract::new(
"oa::crypto::merkle::merkle_frame_verify",
0x606bc6bd8a20f2ac,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("leaf_count", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const MERKLE_SUBTREE_REDUCE: OperationContract = OperationContract::new(
"oa::crypto::merkle::merkle_subtree_reduce",
0x92afa705bbc4c88f,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("leaf_count", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
}
pub mod pqc {
use super::*;
pub(crate) const ML_DSA_44_PUBLIC_KEY_SIZE: usize = 1312;
pub(crate) const ML_DSA_44_SIGNATURE_SIZE: usize = 2420;
pub(crate) const ML_DSA_65_PUBLIC_KEY_SIZE: usize = 1952;
pub(crate) const ML_DSA_65_SIGNATURE_SIZE: usize = 3309;
pub(crate) const ML_DSA_87_PUBLIC_KEY_SIZE: usize = 2592;
pub(crate) const ML_DSA_87_SIGNATURE_SIZE: usize = 4627;
pub const ML_DSA_65_VERIFY_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_65_verify_batch",
0xa1b5a8d75d623915,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_44_VERIFY_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_44_verify_batch",
0xbf20c4567b04ebd4,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_87_VERIFY_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_87_verify_batch",
0x73966f94411e7fe6,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_65_VERIFY_PREHASHED_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_65_verify_prehashed_batch",
0x2bd52b673d44e501,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_44_VERIFY_PREHASHED_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_44_verify_prehashed_batch",
0xe0bfb329fc1a0840,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_87_VERIFY_PREHASHED_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_87_verify_prehashed_batch",
0x9e0e6c4de8c28774,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_65_VERIFY_HASH_MESSAGE_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_65_verify_hash_message_batch",
0xddbb9993fedbcc7c,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_44_VERIFY_HASH_MESSAGE_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_44_verify_hash_message_batch",
0x48d7b7228ad739a3,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
pub const ML_DSA_87_VERIFY_HASH_MESSAGE_BATCH: OperationContract = OperationContract::new(
"oa::crypto::pqc::ml_dsa_87_verify_hash_message_batch",
0x61dfdc3f505ccd96,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_offset", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("context_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("algorithm", OpAttributeKind::UnsignedInteger),
]);
}
}
pub mod image {
use super::*;
pub const RESIZE: OperationContract = OperationContract::new(
"oa::image::resize",
0x38c89d5fa221d139,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("target_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("target_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("interpolation", OpAttributeKind::Enum),
]);
pub const CROP: OperationContract = OperationContract::new(
"oa::image::crop",
0x2651d4c41fb5f2a6,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("x", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("y", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("height", OpAttributeKind::UnsignedInteger),
]);
pub const FLIP: OperationContract = OperationContract::new(
"oa::image::flip",
0xe8c361528c016dce,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("horizontal", OpAttributeKind::Boolean),
OpAttributeSpec::new("vertical", OpAttributeKind::Boolean),
]);
pub const ROTATE: OperationContract = OperationContract::new(
"oa::image::rotate",
0x2e86596413352577,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"degrees",
OpAttributeKind::UnsignedInteger,
)]);
pub const PAD: OperationContract = OperationContract::new(
"oa::image::pad",
0x0b533f428d2c73ea,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("left", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("right", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("top", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("bottom", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const CENTER_CROP: OperationContract = OperationContract::new(
"oa::image::center_crop",
0x8a47c17882639246,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("height", OpAttributeKind::UnsignedInteger),
]);
pub const REMAP: OperationContract = OperationContract::new(
"oa::image::remap",
0x6f6812110a4c4ae9,
&[OpValueKind::Image, OpValueKind::Matrix],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("interpolation", OpAttributeKind::Enum),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const WARP_AFFINE: OperationContract = OperationContract::new(
"oa::image::warp_affine",
0x3f448746adc0df90,
&[OpValueKind::Image, OpValueKind::Matrix],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("interpolation", OpAttributeKind::Enum),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const WARP_PERSPECTIVE: OperationContract = OperationContract::new(
"oa::image::warp_perspective",
0x70929e20efc2937d,
&[OpValueKind::Image, OpValueKind::Matrix],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("interpolation", OpAttributeKind::Enum),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const THRESHOLD_BINARY: OperationContract = OperationContract::new(
"oa::image::threshold_binary",
0xd7b81667446e39b9,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("threshold", OpAttributeKind::Float),
OpAttributeSpec::new("max_value", OpAttributeKind::Float),
]);
pub const THRESHOLD_BINARY_INV: OperationContract = OperationContract::new(
"oa::image::threshold_binary_inv",
0xc6316e8637c15c85,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("threshold", OpAttributeKind::Float),
OpAttributeSpec::new("max_value", OpAttributeKind::Float),
]);
pub const THRESHOLD_TRUNCATE: OperationContract = OperationContract::new(
"oa::image::threshold_truncate",
0xb97f0a67e5225c1b,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("threshold", OpAttributeKind::Float)]);
pub const THRESHOLD_TO_ZERO: OperationContract = OperationContract::new(
"oa::image::threshold_to_zero",
0x48c38a0255987231,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("threshold", OpAttributeKind::Float)]);
pub const THRESHOLD_TO_ZERO_INV: OperationContract = OperationContract::new(
"oa::image::threshold_to_zero_inv",
0x07e73dd34b460226,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("threshold", OpAttributeKind::Float)]);
pub const IN_RANGE: OperationContract = OperationContract::new(
"oa::image::in_range",
0x629863e5bd10f5eb,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("low", OpAttributeKind::Float),
OpAttributeSpec::new("high", OpAttributeKind::Float),
OpAttributeSpec::new("true_value", OpAttributeKind::Float),
]);
pub const CLAMP: OperationContract = OperationContract::new(
"oa::image::clamp",
0xba6e89bce701cf17,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("low", OpAttributeKind::Float),
OpAttributeSpec::new("high", OpAttributeKind::Float),
]);
pub const INVERT: OperationContract = OperationContract::new(
"oa::image::invert",
0x3f4f9c6d53e6c1f3,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("max_value", OpAttributeKind::Float)]);
pub const BRIGHTNESS_CONTRAST: OperationContract = OperationContract::new(
"oa::image::brightness_contrast",
0xa6007d6c7c01d0dd,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("brightness", OpAttributeKind::Float),
OpAttributeSpec::new("contrast", OpAttributeKind::Float),
]);
pub const GAMMA_CONTRAST: OperationContract = OperationContract::new(
"oa::image::gamma_contrast",
0x8d2c5b0bbef70865,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("gamma", OpAttributeKind::Float),
OpAttributeSpec::new("gain", OpAttributeKind::Float),
]);
pub const SOLARIZE: OperationContract = OperationContract::new(
"oa::image::solarize",
0x6a94a4c2e6ee2f81,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("threshold", OpAttributeKind::Float),
OpAttributeSpec::new("max_value", OpAttributeKind::Float),
]);
pub const POSTERIZE: OperationContract = OperationContract::new(
"oa::image::posterize",
0x548a51555dd51eef,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("levels", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("low", OpAttributeKind::Float),
OpAttributeSpec::new("high", OpAttributeKind::Float),
]);
pub const GRAYSCALE: OperationContract = OperationContract::new(
"oa::image::grayscale",
0x01d1514a9b4426ed,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const ALPHA_BLEND: OperationContract = OperationContract::new(
"oa::image::alpha_blend",
0x59996f42ade29f83,
&[OpValueKind::Image, OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const COMPOSITE: OperationContract = OperationContract::new(
"oa::image::composite",
0x74cb8520e5ac861b,
&[OpValueKind::Image, OpValueKind::Image, OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const ERASE: OperationContract = OperationContract::new(
"oa::image::erase",
0x8ebe7ea8f2c21490,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("x", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("y", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("value", OpAttributeKind::Float),
]);
pub const COLOR_TWIST: OperationContract = OperationContract::new(
"oa::image::color_twist",
0x039025b539ad7892,
&[OpValueKind::Image, OpValueKind::Matrix],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CHANNEL_REORDER: OperationContract = OperationContract::new(
"oa::image::channel_reorder",
0xa885438f251535a4,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("channel_0", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("channel_1", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("channel_2", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("channel_3", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("output_format", OpAttributeKind::Enum),
]);
pub const GAUSSIAN_NOISE: OperationContract = OperationContract::new(
"oa::image::gaussian_noise",
0x0ed63b11a093c756,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mean", OpAttributeKind::Float),
OpAttributeSpec::new("stddev", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const SALT_PEPPER_NOISE: OperationContract = OperationContract::new(
"oa::image::salt_pepper_noise",
0xf6d7d3e43c18bf76,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("probability", OpAttributeKind::Float),
OpAttributeSpec::new("salt_value", OpAttributeKind::Float),
OpAttributeSpec::new("pepper_value", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const CONVOLVE_2D: OperationContract = OperationContract::new(
"oa::image::convolve_2d",
0xcad7c4e14b7da03f,
&[OpValueKind::Image, OpValueKind::Matrix],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const SEPARABLE_CONVOLVE_2D: OperationContract = OperationContract::new(
"oa::image::separable_convolve_2d",
0x3eee0317213d1f6a,
&[OpValueKind::Image, OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const AVERAGE_BLUR: OperationContract = OperationContract::new(
"oa::image::average_blur",
0xa97341a1b8478459,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const SOBEL: OperationContract = OperationContract::new(
"oa::image::sobel",
0x880465eb735b334b,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("dx", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("dy", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const SCHARR: OperationContract = OperationContract::new(
"oa::image::scharr",
0xde702c015d1ca3a3,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("dx", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("dy", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const LAPLACIAN: OperationContract = OperationContract::new(
"oa::image::laplacian",
0x4b90d4a67f8c1e66,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("border", OpAttributeKind::Enum)]);
pub const ERODE: OperationContract = OperationContract::new(
"oa::image::erode",
0x81ad6a776aa81f4c,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const DILATE: OperationContract = OperationContract::new(
"oa::image::dilate",
0x1c1e29849b3bbf19,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const MORPHOLOGY_OPEN: OperationContract = OperationContract::new(
"oa::image::morphology_open",
0xd9d2733a7c67f9c9,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const MORPHOLOGY_CLOSE: OperationContract = OperationContract::new(
"oa::image::morphology_close",
0x7de3b99665f5ff82,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const MORPHOLOGY_GRADIENT: OperationContract = OperationContract::new(
"oa::image::morphology_gradient",
0x9b50f7f968e52ddf,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const GAUSSIAN_BLUR: OperationContract = OperationContract::new(
"oa::image::gaussian_blur",
0xd4091d8c0468be75,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("sigma", OpAttributeKind::Float),
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
]);
pub const SHARPEN: OperationContract = OperationContract::new(
"oa::image::sharpen",
0xc421c480cc0744c0,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("amount", OpAttributeKind::Float),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const MEDIAN_BLUR: OperationContract = OperationContract::new(
"oa::image::median_blur",
0xe1bdd2894e3057ef,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const BILATERAL_FILTER: OperationContract = OperationContract::new(
"oa::image::bilateral_filter",
0xec78337adf6fc95a,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("sigma_color", OpAttributeKind::Float),
OpAttributeSpec::new("sigma_space", OpAttributeKind::Float),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const UNSHARP_MASK: OperationContract = OperationContract::new(
"oa::image::unsharp_mask",
0xbef8ac3b37268366,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("sigma", OpAttributeKind::Float),
OpAttributeSpec::new("amount", OpAttributeKind::Float),
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
]);
pub const MORPHOLOGY_TOP_HAT: OperationContract = OperationContract::new(
"oa::image::morphology_top_hat",
0x89c882645a0ac5f3,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const MORPHOLOGY_BLACK_HAT: OperationContract = OperationContract::new(
"oa::image::morphology_black_hat",
0x9e9a389328d20c5e,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("kernel_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
OpAttributeSpec::new("border_value", OpAttributeKind::Float),
]);
pub const ADAPTIVE_THRESHOLD_MEAN: OperationContract = OperationContract::new(
"oa::image::adaptive_threshold_mean",
0xb713a79f905e4fc0,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("c", OpAttributeKind::Float),
OpAttributeSpec::new("max_value", OpAttributeKind::Float),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const ADAPTIVE_THRESHOLD_GAUSSIAN: OperationContract = OperationContract::new(
"oa::image::adaptive_threshold_gaussian",
0x9ffb9c789a7e9cec,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Conv)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("kernel_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("c", OpAttributeKind::Float),
OpAttributeSpec::new("max_value", OpAttributeKind::Float),
OpAttributeSpec::new("sigma", OpAttributeKind::Float),
OpAttributeSpec::new("border", OpAttributeKind::Enum),
]);
pub const NORMALIZE: OperationContract = OperationContract::new(
"oa::image::normalize",
0x56501f0b336cecf3,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mean_0", OpAttributeKind::Float),
OpAttributeSpec::new("mean_1", OpAttributeKind::Float),
OpAttributeSpec::new("mean_2", OpAttributeKind::Float),
OpAttributeSpec::new("std_0", OpAttributeKind::Float),
OpAttributeSpec::new("std_1", OpAttributeKind::Float),
OpAttributeSpec::new("std_2", OpAttributeKind::Float),
]);
pub const CONVERT_COLOR: OperationContract = OperationContract::new(
"oa::image::convert_color",
0x1b4d4d4392048c04,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("source_format", OpAttributeKind::Enum),
OpAttributeSpec::new("destination_format", OpAttributeKind::Enum),
OpAttributeSpec::new("layout", OpAttributeKind::Enum),
]);
pub const RESIZE_NORMALIZE: OperationContract = OperationContract::new(
"oa::FnImage::resizeNormalize",
0x432c1eda1e224052,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.with_control_flow(OpControlFlow::Conditional)
.attributes(&[
OpAttributeSpec::new("width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("mean0", OpAttributeKind::Float),
OpAttributeSpec::new("mean1", OpAttributeKind::Float),
OpAttributeSpec::new("mean2", OpAttributeKind::Float),
OpAttributeSpec::new("std0", OpAttributeKind::Float),
OpAttributeSpec::new("std1", OpAttributeKind::Float),
OpAttributeSpec::new("std2", OpAttributeKind::Float),
]);
pub const SEGMENTATION_OVERLAY: OperationContract = OperationContract::new(
"oa::image::segmentation_overlay",
0x2583cec889ba734a,
&[OpValueKind::Image, OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
}
pub mod vision {
use super::*;
pub const BOX_IOU: OperationContract = OperationContract::new(
"oa::FnDetection::boxIou",
0x2980e9f6b007cee0,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const NMS: OperationContract = OperationContract::new(
"oa::FnDetection::nms",
0x0c4f72fb8deeadb4,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Effect)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("iouThreshold", OpAttributeKind::Float),
OpAttributeSpec::new("scoreThreshold", OpAttributeKind::Float),
OpAttributeSpec::new("maxDetections", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("classAgnostic", OpAttributeKind::Boolean),
]);
pub const CONFUSION_MATRIX: OperationContract = OperationContract::new(
"oa::FnDetection::confusionMatrix",
0xea8866f1cc77e6a7,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"classCount",
OpAttributeKind::SignedInteger,
)]);
pub const BINARY_MASK_COUNTS: OperationContract = OperationContract::new(
"oa::FnDetection::binaryMaskCounts",
0x6a7213ba04980107,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const EVALUATE: OperationContract = OperationContract::new(
"oa::FnDetection::evaluate",
0x2cec5366356b3208,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("classCount", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("scoreThreshold", OpAttributeKind::Float),
]);
pub const EVALUATE_SEGMENTATION: OperationContract = OperationContract::new(
"oa::FnDetection::evaluateSegmentation",
0x22feb53dae982aa3,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Reduce)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"classCount",
OpAttributeKind::SignedInteger,
)]);
}
pub mod video {
use super::*;
pub const RESAMPLE: OperationContract = OperationContract::new(
"oa::video::resample",
0xf8cb1a0b26c226c3,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.variadic_outputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
OpAttributeSpec::new("interpolation", OpAttributeKind::Enum),
OpAttributeSpec::new("out_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("out_height", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("params", OpAttributeKind::String),
]);
pub const TO_MATRIX: OperationContract = OperationContract::new(
"oa::video::to_matrix",
0x8413174e393b4f28,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("channels", OpAttributeKind::Enum),
OpAttributeSpec::new("layout", OpAttributeKind::Enum),
OpAttributeSpec::new("interpolation", OpAttributeKind::Enum),
OpAttributeSpec::new("resize", OpAttributeKind::Enum),
OpAttributeSpec::new("color_space", OpAttributeKind::Enum),
OpAttributeSpec::new("full_range", OpAttributeKind::Boolean),
OpAttributeSpec::new("normalization", OpAttributeKind::String),
OpAttributeSpec::new("crop", OpAttributeKind::String),
]);
pub const OVERLAY: OperationContract = OperationContract::new(
"oa::video::overlay",
0x1996d19d487f20bf,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.variadic_outputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Gather)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
OpAttributeSpec::new("box_count", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("border_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("params", OpAttributeKind::String),
]);
pub const BLEND: OperationContract = OperationContract::new(
"oa::video::blend",
0xd7351d3564ca56af,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.variadic_outputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
OpAttributeSpec::new("alpha", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("fill", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("params", OpAttributeKind::String),
]);
pub const SCORE_BLEND: OperationContract = OperationContract::new(
"oa::video::score_blend",
0xced84e4697b47dfb,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.variadic_outputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
OpAttributeSpec::new("threshold", OpAttributeKind::Float),
OpAttributeSpec::new("fill", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("params", OpAttributeKind::String),
]);
pub const LUMA_MAP: OperationContract = OperationContract::new(
"oa::video::luma_map",
0x02e48e186843f629,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.variadic_outputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
OpAttributeSpec::new("threshold", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("low", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("high", OpAttributeKind::UnsignedInteger),
]);
pub const RANGE_CONVERT: OperationContract = OperationContract::new(
"oa::video::range_convert",
0xb2944c6775df0f27,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.variadic_inputs(OpValueKind::Matrix, 1)
.variadic_outputs(OpValueKind::Matrix, 1)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.with_fusion_class(OpFusionClass::Pointwise)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("mode", OpAttributeKind::Enum),
OpAttributeSpec::new("source_range", OpAttributeKind::Enum),
OpAttributeSpec::new("target_range", OpAttributeKind::Enum),
OpAttributeSpec::new("params", OpAttributeKind::String),
]);
}