pub fn transpose_rule(
op: &StdTensorOp,
builder: &mut impl PrimitiveRuleBuilder,
cotangent_out: &[Option<LocalValueId>],
inputs: &[PrimitiveTransposeInput<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.
ยงErrors
Returns ADRuleError::InvalidInput when the operation, transpose inputs,
or graph metadata are inconsistent. Returns ADRuleError::Unsupported
when the required primitive or extension transpose rule is unavailable.
Errors returned by a registered rule are propagated unchanged.