sakura.utils.gradient_reverse.NeutralizeLayerF.forward

static NeutralizeLayerF.forward(ctx, input_)

Forward pass for gradient neutralization layer (identity transform).

Parameters:
  • ctx (torch.autograd.function.FunctionCtx) – Context object containing saved tensors from forward pass

  • input_ (torch.Tensor) – Input tensor of shape (N, *) for forward pass, where * means number of dimensions

Returns:

Output tensor identical to input_ (shape preserved)

Return type:

torch.Tensor