pushGradients(record, gradients) {
    for (const key in gradients) {
      if (key in record) {
        record[key].push(gradients[key]);
      } else {
        record[key] = [gradients[key]];
      }
    }
  }
Push a new dictionary of gradients into records.

@param {{[varName: string]: tf.Tensor[]}} record The record of variable
  gradient: a map from variable name to the Array of gradient values for
  the variable.
@param {{[varName: string]: tf.Tensor}} gradients The new gradients to push
  into `record`: a map from variable name to the gradient Tensor.