def set_cudnn_batchnorm_mode():
    'Set CuDNN batchnorm mode for better performance.\n\n     Note: Spatial Persistent mode may lead to accuracy losses for certain\n     models.\n  '
    if FLAGS.batchnorm_spatial_persistent:
        os.environ['TF_USE_CUDNN_BATCHNORM_SPATIAL_PERSISTENT'] = '1'
    else:
        os.environ.pop('TF_USE_CUDNN_BATCHNORM_SPATIAL_PERSISTENT', None)
Set CuDNN batchnorm mode for better performance.

Note: Spatial Persistent mode may lead to accuracy losses for certain
models.
def set_cudnn_batchnorm_mode():
    'Set CuDNN batchnorm mode for better performance.\n\n     Note: Spatial Persistent mode may lead to accuracy losses for certain\n     models.\n  '
    if FLAGS.batchnorm_spatial_persistent:
        os.environ['TF_USE_CUDNN_BATCHNORM_SPATIAL_PERSISTENT'] = '1'
    else:
        os.environ.pop('TF_USE_CUDNN_BATCHNORM_SPATIAL_PERSISTENT', None)