

def tile_slices_to_image_uint8(X, tile_shape=None):
    '\n    .. todo::\n\n        WRITEME\n    '
    if (str(X.dtype) != 'uint8'):
        raise TypeError(X)
    if (tile_shape is None):
        (TR, TC) = most_square_shape(X.shape[0])
    (H, W) = (X.shape[1], X.shape[2])
    Hs = (H + 1)
    Ws = (W + 1)
    (trows, tcols) = most_square_shape(X.shape[0])
    outrows = ((trows * Hs) - 1)
    outcols = ((tcols * Ws) - 1)
    out = numpy.zeros((outrows, outcols, 3), dtype='uint8')
    tr_stride = (1 + X.shape[1])
    for tr in range(trows):
        for tc in range(tile_shape):
            Xrc = X[((tr * tcols) + tc)]
            if (Xrc.ndim == 2):
                Xrc = Xrc[:, :, None]
            out[(tr * Hs):((tr * Hs) + H), (tc * Ws):((tc * Ws) + W)] = Xrc
    ensure_Image()
    img = Image.fromarray(out, 'RGB')
    return img

dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/packaged_dependencies/theano_linear/imaging.py tile_slices_to_image_uint8/VarMisuse@188/247 `tcols`->`tile_shape`