Skip to content
Discussion options

You must be logged in to vote

Hi there,

This is likely due to setting torch.set_printoptions, see: https://pytorch.org/docs/stable/generated/torch.set_printoptions.html#torch.set_printoptions

And see: https://discuss.pytorch.org/t/how-to-print-more-than-4-digits-after-decimal/63405

Example

Default print options.

import torch

float16 = torch.tensor([0.0102030405], dtype=torch.float16)
float32 = torch.tensor([0.0102030405], dtype=torch.float32)
float64 = torch.tensor([0.0102030405], dtype=torch.float64)

print(float16)
print(float32)
print(float64)

Output:

tensor([0.0102], dtype=torch.float16)
tensor([0.0102])
tensor([0.0102], dtype=torch.float64)

Set print options precision to 10:

# Set precision equal to 10
torch.se…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AksharGoyal
Comment options

Answer selected by AksharGoyal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants