import tensorflow as tf

tf.app.flags.DEFINE_integer('feats_per_layer', 32, 'Number of feature channels at each layer')
tf.app.flags.DEFINE_boolean('total_pool', True, 'If true, pool all feature maps to 1x1 size in final layer')
tf.app.flags.DEFINE_integer('pool_stride', '1', 'If 2, we get progressive pooling - with overlap pooling, AlexNet style')


TRAIN_FILE = 'train_{}.tfrecords'.format(records.tfrecord_name())
VALIDATION_FILE = 'validation_{}.tfrecords'.format(records.tfrecord_name())

TEST_FILE = 'test_{}.tfrecords'.format(records.tfrecord_name())


def NUM_CLASSES():
  return 10 if FLAGS.parity == 'none' else 5

def read_and_decode(filename_queue):
  reader = tf.TFRecordReader()
  _, serialized_example = reader.read(filename_queue)
  features = tf.parse_single_example(
      serialized_example,
      # Defaults are not specified since both keys are required.
      features={
          'image_raw': tf.FixedLenFeature([], tf.string),
          'label': tf.FixedLenFeature([], tf.int64),
      })

  if FLAGS.contrast_norm == 'areafactor':
      image = tf.decode_raw(features['image_raw'], tf.float32)
  else:
    image = tf.decode_raw(features['image_raw'], tf.uint8)
    image = tf.cast(image, tf.float32) * (1. / 255)
