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::GradNodeUpsample2d;

use crate::ml::matrix::UpsampleMode;

pub(in crate::ml) fn record_upsample_2d(
	input: &Matrix,
	scale_factor: usize,
	mode: UpsampleMode,
	result: &Matrix,
) -> Result<()> {
	record_node(GradNode::Operation(GradNodeOperation::Upsample2d(
		GradNodeUpsample2d {
			input: input.clone(),
			scale_factor,
			mode,
			output_id: result.value_id(),
		},
	)))
}