Skip to content

Instantly share code, notes, and snippets.

@DalyaG
Last active December 1, 2021 17:21
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DalyaG/d8f49f0d83c629129f5cf52ef0f82ccc to your computer and use it in GitHub Desktop.
Save DalyaG/d8f49f0d83c629129f5cf52ef0f82ccc to your computer and use it in GitHub Desktop.
Copy paste this to your first cell in Jupyter Notebook to have wide cells, wide outputs, and inline plots.
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>"))
display(HTML("<style>.output_result { max-width:90% !important; }</style>"))
import numpy as np
np.set_printoptions(precision=3)
np.set_printoptions(linewidth=170)
np.set_printoptions(suppress=True)
np.random.seed(42)
import torch
torch.set_printoptions(precision=7)
torch.set_printoptions(linewidth=170)
torch.set_printoptions(sci_mode=False)
torch.random.manual_seed(42)
import matplotlib.pyplot as plt
%matplotlib inline
from time import time, sleep
sleep(0.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment