import tensorflow as tf

      returns the variable list after applying the filter rule.

  Returns:
    tpu_spec: the TPUEstimatorSpec to run training, evaluation, or prediction.
  """
  if params['transpose_input'] and mode == tf.estimator.ModeKeys.TRAIN:
    features['images'] = tf.transpose(features['images'], [3, 0, 1, 2])

  image_size = (params['image_size'], params['image_size'])
  all_anchors = anchors.Anchors(params['min_level'], params['max_level'],
                                params['num_scales'], params['aspect_ratios'],
                                params['anchor_scale'], image_size)
