learnergy/visual/image.py
def create_mosaic(tensor):
    """Creates a mosaic from a tensor using Pillow.

    Args:
        tensor (Tensor): An input tensor to have its mosaic created.

    """

    # Gets the numpy array from the tensor
    array = tensor.detach().numpy()

    # Calculate their maximum possible squared dimension
    d = int(np.sqrt(array.shape[0]))
    s = int(np.sqrt(array.shape[1]))

    # Creates a Pillow image from the array's rasterized version
    img = Image.fromarray(_rasterize(array.T, img_shape=(
        d, d), tile_shape=(s, s), tile_spacing=(1, 1)))

    # Shows the image
    img.show()
Creates a mosaic from a tensor using Pillow.

    Args:
        tensor (Tensor): An input tensor to have its mosaic created.

    
Creates a mosaic from a tensor using Pillow.
Creates a mosaic from a tensor using Pillow .
def create_mosaic(tensor):
    array = tensor.detach().numpy()
    d = int(np.sqrt(array.shape[0]))
    s = int(np.sqrt(array.shape[1]))
    img = Image.fromarray(_rasterize(array.T, img_shape=(
        d, d), tile_shape=(s, s), tile_spacing=(1, 1)))
    img.show()
def create_mosaic ( tensor ) : array = tensor . detach ( ) . numpy ( ) d = int ( np . sqrt ( array . shape [ 0 ] ) ) s = int ( np . sqrt ( array . shape [ 1 ] ) ) img = Image . fromarray ( _rasterize ( array . T , img_shape = ( d , d ) , tile_shape = ( s , s ) , tile_spacing = ( 1 , 1 ) ) ) img . show ( )
Creates a mosaic from a tensor using Pillow.
Creates a mosaic from a tensor using Pillow .
"""Creates a mosaic from a tensor using Pillow.

    Args:
        tensor (Tensor): An input tensor to have its mosaic created.

    """ # Gets the numpy array from the tensor # Calculate their maximum possible squared dimension # Creates a Pillow image from the array's rasterized version # Shows the image
tensor
An input tensor to have its mosaic created.
An input tensor to have its mosaic created .