Skip to content

Ugly and poorer tensor visualisation with v0.4.0 #6912

@Atcold

Description

@Atcold

numpy deals well with printing arrays.

In [1]: np.array([1, 2, 3])       
Out[1]: array([1, 2, 3])          
                                   
In [2]: print(np.array([1, 2, 3]))
[1 2 3]

torch no longer does.

In [3]: torch.tensor([1, 2, 3])       
Out[3]: tensor([ 1,  2,  3])

In [4]: print(torch.tensor([1, 2, 3]))
tensor([ 1,  2,  3])
 1  2  3
 4  5  6
[torch.FloatTensor of size 2x3]

# was much cleaner (no brackets and commas) and informative (`dtype` and `size`) than

tensor([[ 1,  2,  3], 
        [ 4,  5,  6]])

Metadata

Metadata

Assignees

Labels

module: printingIssues related to the printing format of tensors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions