Skip to content

Pretty printing larger-than-printable Tensor hangs the program #634

Open
@arkanoid87

Description

@arkanoid87
import arraymancer

echo "echo start"
echo newTensor[float](1000, 1000) # < WARN: takes lots of time then floods the terminal
echo "echo end"

it would be nice if pretty printing would actually be so considerate to know when contents is not reasonably printable and return sliced content like numpy and other multi-dimensional array libs do

equivalent numpy output

import numpy as np
arr = np.zeros((1000,1000))
print(arr)
array([[0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.],
       ...,
       [0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.]])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions