function movingAverage_(v, x, decay, step, zeroDebias = true) {
    const $v = (0, _tensorUtilEnv.convertToTensor)(v, "v", "movingAverage");
    const $x = (0, _tensorUtilEnv.convertToTensor)(x, "x", "movingAverage");
    const $decay = (0, _tensorUtilEnv.convertToTensor)(decay, "decay", "movingAverage");
    (0, _tensorUtil.assertTypesMatch)($v, $x);
    _util.assert(_util.arraysEqual($v.shape, $x.shape), ()=>"Shape mismatch in v and x");
    const one = (0, _scalar.scalar)(1);
    const oneMinusDecay = (0, _sub.sub)(one, $decay);
    let update = (0, _mul.mul)((0, _sub.sub)($x, $v), oneMinusDecay);
    if (zeroDebias) {
        _util.assert(step != null, ()=>"When using zeroDebias: true, step is required.");
        const $step = (0, _tensorUtilEnv.convertToTensor)(step, "step", "movingAverage");
        update = (0, _div.div)(update, (0, _sub.sub)(one, (0, _pow.pow)($decay, $step)));
    }
    return (0, _add.add)($v, update);
}
Compute the moving average of a variable.

Without zeroDebias, the moving average operation is defined by:
  `v += delta`
where
  `delta = (1 - decay) * (x - v)`

With zeroDebias (default), the `delta` term is scaled to debias the
effect of the (assumed) zero-initialization of `v`.
  `delta /= (1 - decay ^ step)`

For more details on the zero-debiasing algorithm, see:
  https://arxiv.org/abs/1412.6980

Note that this function is completely stateless and does not keep track of
step count. The step count needs to be maintained by the caller and passed
in as `step`.

@param v The current moving average value.
@param x New input value, must have the same shape and dtype as `v`.
@param decay The decay factor. Typical values are 0.95 and 0.99.
@param step Step count.
@param zeroDebias: Whether zeroDebias is to be performed (default: `true`).
@returns The new moving average value.

@doc {heading: 'Operations', subheading: 'Moving Average'}