Skip to content

repr of tensors seems to have extra space #6918

@alok

Description

@alok
  • PyTorch or Caffe2: Pytorch
  • How you installed PyTorch (conda, pip, source): pip
  • OS: macos 10.13
  • PyTorch version: 0.4.0
  • Python version: 3.6.5

If I run this code in the interpreter,

import torch
t = torch.tensor([1, 2])
repr(t)

I get this output:

tensor([~1,~~2])

I put a ~ instead of a space for clarity. As you can see, extra spaces are printed. This happens even if I create a singleton 1D tensor.

Metadata

Metadata

Assignees

Labels

module: printingIssues related to the printing format of tensorstodoNot as important as medium or high priority tasks, but we will work on these.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions