Skip to main content

transpose_rule

Function transpose_rule 

Source
pub fn transpose_rule(
    op: &StdTensorOp,
    builder: &mut impl PrimitiveRuleBuilder,
    cotangent_out: &[Option<LocalValueId>],
    inputs: &[ValueRef<StdTensorOp>],
    mode: &OperationRole,
    ctx: &mut ShapeGuardContext,
) -> ADRuleResult<Vec<Option<LocalValueId>>>
Expand description

Reverse-mode AD (VJP) for StdTensorOp: given the primal op, its inputs, and the output cotangent, emit the transposed graph and return the input cotangents.

See linearize for the category split; the same categories appear here.