def save_caffe_image(img, filename, autoscale = True, autoscale_center = None):
    '''Takes an image in caffe format (01) or (c01, BGR) and saves it to a file'''
    if len(img.shape) == 2:
        # upsample grayscale 01 -> 01c
        img = np.tile(img[:,:,np.newaxis], (1,1,3))
    else:
        img = img[::-1].transpose((1,2,0))
    if autoscale_center is not None:
        img = norm01c(img, autoscale_center)
    elif autoscale:
        img = img.copy()
        img -= img.min()
        img *= (img.max() + 1e-10) / 1.0
    skimage.io.imsave(filename, img)
dataset/ETHPy150Open yosinski/deep-visualization-toolbox/find_maxes/caffe_misc.py/save_caffe_image/swapped operands of `/`