Printing complex tensors yields extra white spaces that follow the element. This seems to be related to the way that self.max_width is set in the Formatter constructor.
This is a follow up to the conversation that can be found here: #35841
To Reproduce
print(torch.tensor([[1 + 1.340j, 3 + 4j], [1.2 + 1.340j, 6.5 + 7j]], dtype=torch.complex64))
Will yield
tensor([[ (1.0000 + 1.3400j),
(3.0000 + 4.0000j)],
[ (1.2000 + 1.3400j),
(6.5000 + 7.0000j)]], dtype=torch.complex64)
Expected behavior
Instead, we want it to look like
tensor([[(1.0000 + 1.3400j),
(3.0000 + 4.0000j)],
[(1.2000 + 1.3400j),
(6.5000 + 7.0000j)]], dtype=torch.complex64)
cc @ezyang @anjali411 @dylanbespalko
Printing complex tensors yields extra white spaces that follow the element. This seems to be related to the way that
self.max_widthis set in the Formatter constructor.This is a follow up to the conversation that can be found here: #35841
To Reproduce
Will yield
Expected behavior
Instead, we want it to look like
cc @ezyang @anjali411 @dylanbespalko