PyTorch torch.set_printoptions function
PyTorch torch reference manual
torch.set_printoptions is a function in PyTorch used to set tensor printing options.
Function definition
torch.set_printoptions(precision, threshold, edgeitems, linewidth, profile, sci_mode)
Usage examples
Example
import
torch
Set the printing precision to 2 decimal places
torch.
set_printoptions
(
precision
=
2
)
x
=
torch.
randn
(
3
,
3
)
(
x
)