use super::{
OpAttributeKind, OpAttributeSpec, OpDTypeRule, OpDifferentiation, OpEffect, OpLowering,
OpShapeRule, OpValueKind, OperationContract,
};
pub mod matrix {
use super::*;
pub const ADD: OperationContract = OperationContract::new(
"oa::matrix::add",
0xc31536fb33ea7081,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SUB: OperationContract = OperationContract::new(
"oa::matrix::sub",
0x19de1f471945126f,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MUL: OperationContract = OperationContract::new(
"oa::matrix::mul",
0x090a3452e4905905,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const DIV: OperationContract = OperationContract::new(
"oa::matrix::div",
0x6a012a07aea81cae,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Broadcast)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SCALE: OperationContract = OperationContract::new(
"oa::matrix::scale",
0xd0f67a5776a01f86,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const NEG: OperationContract = OperationContract::new(
"oa::matrix::neg",
0x30ef2b6f46263b0a,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const ABS: OperationContract = OperationContract::new(
"oa::matrix::abs",
0x54890f46f07cabb6,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const LOG: OperationContract = OperationContract::new(
"oa::matrix::log",
0x1b0bc7fdbe2d1ff8,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SQRT: OperationContract = OperationContract::new(
"oa::matrix::sqrt",
0x450de3efd159a678,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("exponent", OpAttributeKind::Float)]);
pub const ADD_SCALAR: OperationContract = OperationContract::new(
"oa::matrix::add_scalar",
0x823309505fa8af04,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const SUB_SCALAR: OperationContract = OperationContract::new(
"oa::matrix::sub_scalar",
0x511811a2f7247c19,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const DIV_SCALAR: OperationContract = OperationContract::new(
"oa::matrix::div_scalar",
0x5a6d3671dc4faeea,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scalar", OpAttributeKind::Float)]);
pub const EXP: OperationContract = OperationContract::new(
"oa::matrix::exp",
0x3da1f3290b49e07f,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const RECIPROCAL: OperationContract = OperationContract::new(
"oa::matrix::reciprocal",
0xc85f8393f833af44,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CLAMP_MAX: OperationContract = OperationContract::new(
"oa::matrix::clamp_max",
0xca4b337467939f09,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("maximum", OpAttributeKind::Float)]);
pub const CLAMP_MIN: OperationContract = OperationContract::new(
"oa::matrix::clamp_min",
0xc845c52101043530,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("minimum", OpAttributeKind::Float)]);
pub const COPY: OperationContract = OperationContract::new(
"oa::matrix::copy",
0xa63a6db84cdd84de,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MAT_MUL_NT: OperationContract = OperationContract::new(
"oa::matrix::mat_mul_nt",
0xae3e842111065959,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatMulNt)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SOFTMAX: OperationContract = OperationContract::new(
"oa::matrix::softmax",
0xbb21c75658e4d7be,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const LOG_SOFTMAX: OperationContract = OperationContract::new(
"oa::matrix::log_softmax",
0x47e53d8d32374130,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const SUM: OperationContract = OperationContract::new(
"oa::matrix::sum",
0x02b7d51391ffc07e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const CATEGORICAL_ACCURACY_COUNT: OperationContract = OperationContract::new(
"oa::matrix::categorical_accuracy_count",
0x8a7a0d02fc408718,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MASKED_CATEGORICAL_ACCURACY_COUNT: OperationContract = OperationContract::new(
"oa::matrix::masked_categorical_accuracy_count",
0x306deeec2d0c19b6,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const PHILOX_UNIFORM: OperationContract = OperationContract::new(
"oa::matrix::philox_uniform",
0x994c34f6960da512,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.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::matrix::philox_normal",
0xc174617ce42253fb,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.mutated_inputs(0x01)
.alias(0, 0);
pub const DROPOUT: OperationContract = OperationContract::new(
"oa::matrix::dropout",
0xd6815f3097c5e721,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.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)
.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::matrix::sample_logits",
0xc04e54a248d225c3,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("temperature", OpAttributeKind::Float),
OpAttributeSpec::new("top_k", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("top_p", OpAttributeKind::Float),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
]);
pub const TOP_K: OperationContract = OperationContract::new(
"oa::matrix::top_k",
0xf216ba8ab445b4a3,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix, OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("k", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger),
]);
pub const TOP_K_MASK: OperationContract = OperationContract::new(
"oa::matrix::top_k_mask",
0x52a8a23650a72dde,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"num_experts",
OpAttributeKind::SignedInteger,
)]);
pub const MOE_EXPERT_PLAN: OperationContract = OperationContract::new(
"oa::matrix::moe_expert_plan",
0x276a9fe7ef3b586d,
&[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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"num_experts",
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)
.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::matrix::slice",
0x6612de9be5991f35,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.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::matrix::repeat_interleave",
0x52f219bcfcfdec94,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.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::matrix::gather",
0xd2059fe5d43d04d8,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("input_shape", OpAttributeKind::Shape)]);
pub const GATHER_LAST_DIM: OperationContract = OperationContract::new(
"oa::matrix::gather_last_dim",
0xf6a773f47bf8b88b,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"input_width",
OpAttributeKind::SignedInteger,
)]);
pub const CONCAT: OperationContract = OperationContract::new(
"oa::matrix::concat",
0x6d5f81e049518596,
&[],
&[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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("dim", OpAttributeKind::SignedInteger)]);
pub const TRANSPOSE: OperationContract = OperationContract::new(
"oa::matrix::transpose",
0xa86500f9d70b321c,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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::matrix::equal",
0xdaa6d8f087bb3692,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("value", OpAttributeKind::Float)]);
}
pub mod ml {
use super::*;
pub const PPO_CLIPPED_POLICY: OperationContract = OperationContract::new(
"oa::ml::loss::ppo_clipped_policy",
0x39ec34fa17765fbb,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("clip_epsilon", 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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("clip_epsilon", OpAttributeKind::Float)]);
pub const LINEAR: OperationContract = OperationContract::new(
"oa::ml::matrix::linear",
0xcaa9f4b327a8e491,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CROSS_ENTROPY: OperationContract = OperationContract::new(
"oa::ml::loss::cross_entropy",
0x384b0398d94da855,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MASKED_CROSS_ENTROPY: OperationContract = OperationContract::new(
"oa::ml::loss::masked_cross_entropy",
0x364fbd7858e31d41,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"valid_count",
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"valid_count",
OpAttributeKind::SignedInteger,
)]);
pub const SMOOTH_L1: OperationContract = OperationContract::new(
"oa::ml::loss::smooth_l1",
0x6fc163ddaacb0762,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MSE: OperationContract = OperationContract::new(
"oa::ml::loss::mse",
0xb7bd975e33b87b4f,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const L1: OperationContract = OperationContract::new(
"oa::ml::loss::l1",
0xf3a08f0d67883bd1,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BCE: OperationContract = OperationContract::new(
"oa::ml::loss::bce",
0x020db69248ac0d6f,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const CHANNEL_NORM: OperationContract = OperationContract::new(
"oa::ml::matrix::channel_norm",
0xb19754f4ad595633,
&[
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)
.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_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)
.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::ml::matrix::channel_norm_relu",
0x8c87c9a07ec6d989,
&[
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)
.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_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)
.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::ml::matrix::rnn_scan",
0x88f248068a42a484,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
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)
.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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const RMS_NORM: OperationContract = OperationContract::new(
"oa::ml::matrix::rms_norm",
0x958fefa031adb516,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", 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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const GELU: OperationContract = OperationContract::new(
"oa::ml::matrix::gelu",
0x2c7ff17418821ecc,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SILU: OperationContract = OperationContract::new(
"oa::ml::matrix::silu",
0x25a920438283ed73,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const RELU: OperationContract = OperationContract::new(
"oa::ml::matrix::relu",
0xd84378588ab67f06,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const TANH: OperationContract = OperationContract::new(
"oa::ml::matrix::tanh",
0x96965c7d4abdf6dc,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SIGMOID: OperationContract = OperationContract::new(
"oa::ml::matrix::sigmoid",
0xd344fae6e6a82660,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const LEAKY_RELU: OperationContract = OperationContract::new(
"oa::ml::matrix::leaky_relu",
0x20985fd7a18e1a98,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const ELU: OperationContract = OperationContract::new(
"oa::ml::matrix::elu",
0xfcb631a632261391,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const MISH: OperationContract = OperationContract::new(
"oa::ml::matrix::mish",
0x9f9e8dafcf6df92d,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SOFTPLUS: OperationContract = OperationContract::new(
"oa::ml::matrix::softplus",
0xc0efbd33e9c70ec8,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SWIGLU: OperationContract = OperationContract::new(
"oa::ml::matrix::swiglu",
0xd46645c4a103369d,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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::ml::matrix::gru_scan",
0x26163cc1f21e75d1,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
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)
.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)
.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)
.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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("has_bias", OpAttributeKind::Boolean)]);
pub const BMM: OperationContract = OperationContract::new(
"oa::ml::matrix::bmm",
0x1dc9edbd78c6023b,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BMM_NT: OperationContract = OperationContract::new(
"oa::ml::matrix::bmm_nt",
0x9ea0f269061674e2,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const BMM_TN: OperationContract = OperationContract::new(
"oa::ml::matrix::bmm_tn",
0x313bfcf8618c24eb,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const SPLIT_HEADS: OperationContract = OperationContract::new(
"oa::ml::matrix::split_heads",
0x546d97353b2bf7de,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("sequence_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("num_heads", OpAttributeKind::UnsignedInteger),
]);
pub const MERGE_HEADS: OperationContract = OperationContract::new(
"oa::ml::matrix::merge_heads",
0x2aa1370f58128fe0,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("batch", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("sequence_length", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("num_heads", OpAttributeKind::UnsignedInteger),
]);
pub const SOFTMAX_SCALED_MASKED: OperationContract = OperationContract::new(
"oa::ml::matrix::softmax_scaled_masked",
0x5f09dc3fecb49ca8,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("scale", OpAttributeKind::Float)]);
pub const SCALED_DOT_PRODUCT_ATTENTION: OperationContract = OperationContract::new(
"oa::ml::matrix::scaled_dot_product_attention",
0xc6f3f56a3525e11f,
&[
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)
.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)
.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::ml::matrix::moe_route_weights",
0x0e0b5fc146ace9c3,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MOE_GATHER: OperationContract = OperationContract::new(
"oa::ml::matrix::moe_gather",
0xde1cc9d06dea01c7,
&[
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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_rows",
OpAttributeKind::SignedInteger,
)]);
pub const MOE_COMBINE: OperationContract = OperationContract::new(
"oa::ml::matrix::moe_combine",
0xfc93a113d0b92b69,
&[
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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GROUPED_LINEAR_M: OperationContract = OperationContract::new(
"oa::ml::matrix::grouped_linear_m",
0x75f1d0502c3e9641,
&[
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)
.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)
.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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"intermediate_size",
OpAttributeKind::SignedInteger,
)]);
pub const GROUPED_GEMM_M: OperationContract = OperationContract::new(
"oa::ml::matrix::grouped_gemm_m",
0x4c869b03b49991b9,
&[
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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const LINEAR_MATCH: OperationContract = OperationContract::new(
"oa::ml::flow::linear_match",
0x483c5e0d5a6a50d0,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const EULER_STEP: OperationContract = OperationContract::new(
"oa::ml::flow::euler_step",
0x6b8edb35f8f0e111,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("delta_time", OpAttributeKind::Float)]);
pub const MASKED_MSE: OperationContract = OperationContract::new(
"oa::ml::flow::masked_mse",
0x16ec3d2aae193c76,
&[
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)
.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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const GAE: OperationContract = OperationContract::new(
"oa::ml::advantage::gae",
0xa6f7c0d798479579,
&[
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)
.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)
.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)
.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)
.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)
.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 CART_POLE_RESET: OperationContract = OperationContract::new(
"oa::ml::environment::cart_pole_reset",
0x2ba92f2ad674c3b6,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("only_completed", OpAttributeKind::Boolean),
])
.mutated_inputs(0x0f)
.alias(0, 0)
.alias(1, 1)
.alias(2, 2)
.alias(3, 3);
pub const CART_POLE_STEP: OperationContract = OperationContract::new(
"oa::ml::environment::cart_pole_step",
0xced0b0b0da5bbd95,
&[
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,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("dynamics_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("dynamics_identity", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("max_episode_steps", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("gravity", OpAttributeKind::Float),
OpAttributeSpec::new("force_magnitude", OpAttributeKind::Float),
OpAttributeSpec::new("time_step", OpAttributeKind::Float),
OpAttributeSpec::new("position_threshold", OpAttributeKind::Float),
OpAttributeSpec::new("angle_threshold_radians", OpAttributeKind::Float),
])
.mutated_inputs(0xfe)
.alias(0, 2)
.alias(1, 1)
.alias(2, 3)
.alias(3, 4)
.alias(4, 5)
.alias(5, 6)
.alias(6, 7);
pub const LUNAR_LANDER_RESET: OperationContract = OperationContract::new(
"oa::ml::environment::lunar_lander_reset",
0x41dd70d22a83b84a,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("environment_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("state_layout_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("seed", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("only_completed", OpAttributeKind::Boolean),
])
.mutated_inputs(0x78)
.alias(0, 3)
.alias(1, 4)
.alias(2, 5)
.alias(3, 6);
pub const LUNAR_LANDER_STEP: OperationContract = OperationContract::new(
"oa::ml::environment::lunar_lander_step",
0xd6945ccbcb5307fb,
&[
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
OpValueKind::Matrix,
],
&[],
)
.variadic_inputs(OpValueKind::Matrix, 8)
.variadic_outputs(OpValueKind::Matrix, 8)
.aligned_variadic_aliases()
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("environment_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("physics_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("observation_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("reward_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("state_layout_version", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("config_identity", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("max_episode_steps", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("failure_penalty", OpAttributeKind::Float),
]);
pub const RMS_NORM_GATED: OperationContract = OperationContract::new(
"oa::ml::matrix::rms_norm_gated",
0xd9d7b98c65e7a35c,
&[
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)
.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 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)
.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::ml::matrix::mamba3_preprocess",
0xe491cad1c95eadc1,
&[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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
OpAttributeKind::UnsignedInteger,
)]);
pub const MAMBA3_SISO: OperationContract = OperationContract::new(
"oa::ml::matrix::mamba3_siso",
0x9676c9c84cb6b9cd,
&[],
&[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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
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)
.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)
.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::ml::matrix::mamba3_mimo",
0x48df323584dfad3e,
&[],
&[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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"config_identity",
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)
.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)
.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::ml::matrix::vq_assign",
0xd8f0d2b32994588c,
&[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)
.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)
.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)
.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 NORMALIZE_OBSERVATION: OperationContract = OperationContract::new(
"oa::ml::environment::normalize_observation",
0x9e070d2d15d70368,
&[
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)
.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::ml::environment::scale_action",
0xbd59652868c6010e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("source_minimum", OpAttributeKind::Float),
OpAttributeSpec::new("source_maximum", OpAttributeKind::Float),
OpAttributeSpec::new("target_minimum", OpAttributeKind::Float),
OpAttributeSpec::new("target_maximum", OpAttributeKind::Float),
OpAttributeSpec::new("clamp", OpAttributeKind::Boolean),
]);
pub const CLIP_REWARD: OperationContract = OperationContract::new(
"oa::ml::environment::clip_reward",
0xd15f83bc7ac0313e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.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::ml::advantage::normalize",
0x033a42736a6612ad,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::Reverse)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("epsilon", OpAttributeKind::Float)]);
pub const PPO: OperationContract = OperationContract::new(
"oa::ml::loss::ppo",
0x2d36894147b36625,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("clip_epsilon", OpAttributeKind::Float),
OpAttributeSpec::new("value_coefficient", OpAttributeKind::Float),
OpAttributeSpec::new("entropy_coefficient", OpAttributeKind::Float),
]);
pub const DQN: OperationContract = OperationContract::new(
"oa::ml::loss::dqn",
0x9e44032415d85881,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("discount", OpAttributeKind::Float)]);
pub const SAC_CRITIC: OperationContract = OperationContract::new(
"oa::ml::loss::sac_critic",
0x25929db83c0f28e8,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("discount", OpAttributeKind::Float),
OpAttributeSpec::new("entropy_coefficient", OpAttributeKind::Float),
]);
pub const SAC_ACTOR: OperationContract = OperationContract::new(
"oa::ml::loss::sac_actor",
0x33829e9090fc9b67,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"entropy_coefficient",
OpAttributeKind::Float,
)]);
pub const SAMPLE_CATEGORICAL: OperationContract = OperationContract::new(
"oa::ml::policy::sample_categorical",
0x2ca51b2b3162e08e,
&[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)
.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::ml::policy::evaluate_categorical",
0x224e18c97330178d,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.alias(0, 1)
.alias(3, 2);
pub const SAMPLE_TANH_NORMAL: OperationContract = OperationContract::new(
"oa::ml::policy::sample_tanh_normal",
0xfa854601641e1748,
&[
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)
.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::ml::policy::evaluate_tanh_normal",
0xfdcb25bfb47b4bcf,
&[
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)
.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 mod audio {
use super::*;
pub const NORMALIZE: OperationContract = OperationContract::new(
"oa::audio::normalize",
0x3b3df2a52d4d8156,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("target_db", OpAttributeKind::Float),
OpAttributeSpec::new("mode", OpAttributeKind::UnsignedInteger),
]);
pub const RESAMPLE: OperationContract = OperationContract::new(
"oa::audio::resample",
0x4aefd8eeeff88a33,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("out_rate", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("filter_half_width", OpAttributeKind::UnsignedInteger),
]);
pub const GAIN: OperationContract = OperationContract::new(
"oa::audio::gain",
0xf655c5c7dd96ed60,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("gain_db", OpAttributeKind::Float)]);
pub const CLIP: OperationContract = OperationContract::new(
"oa::audio::clip",
0xbb4a06aba2ed0cb8,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("minimum", OpAttributeKind::Float),
OpAttributeSpec::new("maximum", OpAttributeKind::Float),
]);
pub const SATURATE: OperationContract = OperationContract::new(
"oa::audio::saturate",
0x7198fc9c100b810b,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("drive_db", OpAttributeKind::Float),
OpAttributeSpec::new("mix", OpAttributeKind::Float),
]);
pub const BIQUAD: OperationContract = OperationContract::new(
"oa::audio::biquad",
0xbac872f275d91b2e,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.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::audio::reverb",
0x47668b82a756d3e9,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("decay_seconds", OpAttributeKind::Float),
OpAttributeSpec::new("wet", OpAttributeKind::Float),
]);
pub const SOS_FILTER: OperationContract = OperationContract::new(
"oa::audio::sos_filter",
0xe37445f1a5eb7cc5,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("section_count", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("coefficient_hash", OpAttributeKind::UnsignedInteger),
]);
pub const PRE_EMPHASIS: OperationContract = OperationContract::new(
"oa::audio::pre_emphasis",
0x65f9e7929f526b5c,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("alpha", OpAttributeKind::Float)]);
pub const TO_MONO: OperationContract = OperationContract::new(
"oa::audio::to_mono",
0x2fbad121baf08f78,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const FADE: OperationContract = OperationContract::new(
"oa::audio::fade",
0x6a356f0c7eb23953,
&[OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fade_in_samples", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("fade_out_samples", OpAttributeKind::UnsignedInteger),
]);
pub const MIX: OperationContract = OperationContract::new(
"oa::audio::mix",
0x355de51d3346d30a,
&[OpValueKind::Audio, OpValueKind::Audio],
&[OpValueKind::Audio],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("gain_a", OpAttributeKind::Float),
OpAttributeSpec::new("gain_b", OpAttributeKind::Float),
]);
pub const AMPLITUDE_TO_DB: OperationContract = OperationContract::new(
"oa::audio::amplitude_to_db",
0x95677cee9dc95577,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new("floor_db", OpAttributeKind::Float)]);
pub const WAVEFORM_ENVELOPE: OperationContract = OperationContract::new(
"oa::audio::waveform_envelope",
0x1560d95ce87bbd5c,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"bins",
OpAttributeKind::UnsignedInteger,
)]);
pub const STFT: OperationContract = OperationContract::new(
"oa::audio::stft",
0x7324d7bfd3b3ccf2,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fft_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hop_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("win_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("window", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("center", OpAttributeKind::Boolean),
]);
pub const MEL_SPECTROGRAM: OperationContract = OperationContract::new(
"oa::audio::mel_spectrogram",
0xd9509384865df2e0,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("fft_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hop_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("num_mels", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("f_min", OpAttributeKind::Float),
OpAttributeSpec::new("f_max", OpAttributeKind::Float),
OpAttributeSpec::new("log_scale", OpAttributeKind::Boolean),
OpAttributeSpec::new("normalize", OpAttributeKind::Boolean),
]);
pub const MFCC: OperationContract = OperationContract::new(
"oa::audio::mfcc",
0x351110749a8fd1af,
&[OpValueKind::Audio],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("num_coeffs", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("fft_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("hop_size", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("num_mels", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("f_min", OpAttributeKind::Float),
OpAttributeSpec::new("f_max", OpAttributeKind::Float),
OpAttributeSpec::new("log_scale", OpAttributeKind::Boolean),
OpAttributeSpec::new("normalize", OpAttributeKind::Boolean),
]);
}
pub mod cryptography {
use super::*;
pub mod hash {
use super::*;
pub const SHAKE128: OperationContract = OperationContract::new(
"oa::cryptography::hash::shake128",
0xefb3f5a247c1210e,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_length",
OpAttributeKind::UnsignedInteger,
)]);
pub const SHAKE256: OperationContract = OperationContract::new(
"oa::cryptography::hash::shake256",
0x76a820ac911e606f,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"output_length",
OpAttributeKind::UnsignedInteger,
)]);
pub const KECCAK_F1600: OperationContract = OperationContract::new(
"oa::cryptography::hash::keccak_f1600",
0x7a8be5ad50811fec,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::MatchInput)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const MERKLE_ROOT: OperationContract = OperationContract::new(
"oa::cryptography::hash::merkle_root",
0x69c8d3661c719a01,
&[OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
}
pub mod pqc {
use super::*;
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_44_PUBLIC_KEY_SIZE: usize = 1312;
pub(crate) const ML_DSA_44_SIGNATURE_SIZE: usize = 2420;
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::cryptography::pqc::ml_dsa_65_verify_batch",
0xe16f9ed176bc3d7c,
&[
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)
.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::cryptography::pqc::ml_dsa_44_verify_batch",
0xe583c6a2d5fb3df0,
&[
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)
.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::cryptography::pqc::ml_dsa_87_verify_batch",
0x559f97fba6a47fcf,
&[
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)
.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::cryptography::pqc::ml_dsa_65_verify_prehashed_batch",
0x91276cc4d5695dba,
&[
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)
.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::cryptography::pqc::ml_dsa_44_verify_prehashed_batch",
0x0127763812d37833,
&[
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)
.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::cryptography::pqc::ml_dsa_87_verify_prehashed_batch",
0x43f4117968c91701,
&[
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)
.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::cryptography::pqc::ml_dsa_65_verify_hash_message_batch",
0x88e9074e346a9136,
&[
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)
.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::cryptography::pqc::ml_dsa_44_verify_hash_message_batch",
0xc9735ad3496603af,
&[
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)
.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::cryptography::pqc::ml_dsa_87_verify_hash_message_batch",
0x0d56b08c06ba1ef6,
&[
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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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",
0x4e04b1fa6088d23f,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"destination_format",
OpAttributeKind::Enum,
)]);
pub const RESIZE_NORMALIZE: OperationContract = OperationContract::new(
"oa::image::resize_normalize",
0x6c811b5a2c92171f,
&[OpValueKind::Image],
&[OpValueKind::Image],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("target_width", OpAttributeKind::UnsignedInteger),
OpAttributeSpec::new("target_height", OpAttributeKind::UnsignedInteger),
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 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)
.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::vision::box_iou",
0x69e65dc40b33dc7a,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::MatchInput)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const NMS: OperationContract = OperationContract::new(
"oa::vision::nms",
0xe2a7f9d345c191d3,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("iou_threshold", OpAttributeKind::Float),
OpAttributeSpec::new("score_threshold", OpAttributeKind::Float),
OpAttributeSpec::new("max_detections", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("class_agnostic", OpAttributeKind::Boolean),
]);
pub const CONFUSION_MATRIX: OperationContract = OperationContract::new(
"oa::vision::confusion_matrix",
0x03a9c6c232e211d6,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"class_count",
OpAttributeKind::SignedInteger,
)]);
pub const BINARY_MASK_COUNTS: OperationContract = OperationContract::new(
"oa::vision::binary_mask_counts",
0x53c8085ae3d99224,
&[OpValueKind::Matrix, OpValueKind::Matrix],
&[OpValueKind::Matrix],
)
.with_shape_rule(OpShapeRule::Explicit)
.with_dtype_rule(OpDTypeRule::Explicit)
.with_differentiation(OpDifferentiation::None)
.with_lowering(OpLowering::Dispatch)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS));
pub const EVALUATE: OperationContract = OperationContract::new(
"oa::vision::evaluate",
0x33e14625c158f232,
&[
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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[
OpAttributeSpec::new("class_count", OpAttributeKind::SignedInteger),
OpAttributeSpec::new("score_threshold", OpAttributeKind::Float),
]);
pub const EVALUATE_SEGMENTATION: OperationContract = OperationContract::new(
"oa::vision::evaluate_segmentation",
0xe186482c551eeef7,
&[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)
.effects(OpEffect::READ_INPUTS.union(OpEffect::WRITE_OUTPUTS))
.attributes(&[OpAttributeSpec::new(
"class_count",
OpAttributeKind::SignedInteger,
)]);
}