torch.set_printoptions

torch.set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, profile=None, sci_mode=None) [source]

Set options for printing. Items shamelessly taken from NumPy

Parameters
  • precision – Number of digits of precision for floating point output (default = 4).
  • threshold – Total number of array elements which trigger summarization rather than full repr (default = 1000).
  • edgeitems – Number of array items in summary at beginning and end of each dimension (default = 3).
  • linewidth – The number of characters per line for the purpose of inserting line breaks (default = 80). Thresholded matrices will ignore this parameter.
  • profile – Sane defaults for pretty printing. Can override with any of the above options. (any one of default, short, full)
  • sci_mode – Enable (True) or disable (False) scientific notation. If None (default) is specified, the value is defined by torch._tensor_str._Formatter. This value is automatically chosen by the framework.

© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/generated/torch.set_printoptions.html