     // public func _vjpApplied(to input: Tensor<Scalar>) ->
     //     (Tensor<Scalar>, (Tensor<Scalar>) ->
     //         (BatchNorm<Scalar>.CotangentVector, Tensor<Scalar>)) {
-    //     if mode.training {
-    //         return Swift.valueWithPullback(at: self, input) {
+    //     if learningPhaseIndicator.training {
+    //         return self.valueWithPullback(at: input) {
     //             $0.applyTraining(to: $1)
     //         }
     //     } else {
-    //         return Swift.valueWithPullback(at: self, input) {
+    //         return self.valueWithPullback(at: input) {
     //             $0.applyInference(to: $1)
     //         }
     //     }

    /// The running variance.
    @noDerivative public let runningVariance: Parameter<Scalar>

    @noDerivative public let mode: ModeRef

    @differentiable(wrt: (self, input))
    private func applyTraining(to input: Tensor<Scalar>) -> Tensor<Scalar> {

/// In typical uses, every layer in a model that has behavior which differs
/// between training and inference shares an instance of ModeRef so it doesn't
/// need to be toggled or threaded through in more than one place.
public class LearningPhaseIndicator {
    public var training: Bool = true
}

