def save_tiled_raster_images(tiled_img, filename):
    if tiled_img.ndim==2:
        ensure_Image()
        img = Image.fromarray( tiled_img, 'L')
    elif tiled_img.ndim==3:
        ensure_Image()
        img = Image.fromarray(tiled_img, 'RGBA')
    else:
        raise TypeError('bad ndim', tiled_img)

    img.save(filename)
    return img
Save a a return value from `tile_raster_images` to `filename`.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/packaged_dependencies/theano_linear/imaging.py/save_tiled_raster_images