import tensorflow as tf

    model = p.cls(p)
    model._task.CreateChild('a',
                            layers.BatchNormLayer.Params().Set(name='a', dim=1))
    model._task._train_op = tf.no_op()
    model._task.ApplyExponentialMovingAverage(model.ema)
    with tf.variable_scope('', reuse=True):
      beta = tf.get_variable('a/beta/var')
      mean = tf.get_variable('a/moving_mean/var')
      self.assertIsNotNone(model.ema.average(beta))
      self.assertIsNone(model.ema.average(mean))


class MultiTaskModelTest(tf.test.TestCase):

