Skip to content

Instantly share code, notes, and snippets.

@HTLife
HTLife / summary.py
Created March 16, 2018 06:37
Pytorch model summary
def summary(input_size, model):
def register_hook(module):
def hook(module, input, output):
class_name = str(module.__class__).split('.')[-1].split("'")[0]
module_idx = len(summary)
m_key = '%s-%i' % (class_name, module_idx+1)
summary[m_key] = OrderedDict()
summary[m_key]['input_shape'] = list(input[0].size())
summary[m_key]['input_shape'][0] = -1
@rcugut
rcugut / [GUIDE] macos yarn nvm install.md
Last active July 10, 2023 11:49
GUIDE for mac OS X yarn nvm node install

GUIDE to install yarn, nvm (node) on macOS

last update: Dec 4, 2020

Assumptions:

  • macOS >= 10.14 (Mojave); tested with 10.15 (Catalina)
  • homebrew properly installed
@bygreencn
bygreencn / ubuntu_cuda10.1.sh
Last active June 22, 2019 01:31 — forked from fo40225/ubuntu1804cuda10.sh
install cuda 10.1 on ubuntu
sudo apt update
sudo apt -y install build-essential
sudo apt -y install linux-headers-$(uname -r)
wget -N https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.168_418.67_linux.run
wget -N http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.0/cudnn-10.1-linux-x64-v7.6.0.64.tgz
wget -N https://developer.download.nvidia.com/compute/redist/nccl/v2.4/nccl_2.4.7-1+cuda10.1_x86_64.txz
#Disable nouveau driver
echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf > /dev/null