NUM_THREADS=16
    config = tf.ConfigProto(inter_op_parallelism_threads=NUM_THREADS,
    intra_op_parallelism_threads=NUM_THREADS,
    log_device_placement=False,
    allow_soft_placement=True,
    gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=fraction))
    config.gpu_options.allow_growth = True