Skip to content

Printing tensors is sometimes very slow #109

@rbgirshick

Description

@rbgirshick

I was playing with the mnist example just now and wanted to print the first training example. So after the line

training_data = training_set[0].view(-1, 1, 28, 28).div(255)

I wrote

print(training_data[0])

Printing took ~33 seconds on my mbp. print(training_data[0].numpy()) is instantaneous.

Oddly,

a = torch.FloatTensor(1, 28,28)
print(a)

which prints a tensor of the same shape an type is fast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions