oarust 0.8.6

GPU-first semantic computing engine written in Rust
// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=ml_training.json schema_version=1 generator_version=64
// schema_sha256=6678961ee57f24310158676c7b4fe0821e21ca48db7edcb20d2a749a164976ae
// Mechanical tape attachments; concrete saved-state node behavior remains private.

use crate::{Matrix, Result};

use crate::ml::autograd::{
	node::{GradNode, operation::GradNodeOperation},
	tape::record_node,
};

use crate::ml::autograd::node::operation::GradNodeRope;

pub(in crate::ml) fn record_rope(
	input: &Matrix,
	num_heads: usize,
	head_dim: usize,
	theta_base: f32,
	position_offset: u32,
	result: &Matrix,
) -> Result<()> {
	record_node(GradNode::Operation(GradNodeOperation::Rope(GradNodeRope {
		input: input.clone(),
		num_heads,
		head_dim,
		theta_base,
		position_offset,
		output_id: result.value_id(),
	})))
}