Skip to content

Instantly share code, notes, and snippets.

@dimidd
Forked from DalyaG/my_first_cell_in_ipynb.py
Created October 8, 2020 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimidd/4c6ecc92ec9ab6b203ccb416af627009 to your computer and use it in GitHub Desktop.
Save dimidd/4c6ecc92ec9ab6b203ccb416af627009 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