torch.set_printoptions(profile="full") print(x) # prints the whole tensor torch.set_printoptions(profile="default") # reset print(x) # prints the truncated tensor