nvm 是 Node.js 的版本管理器,可以让你方便地管理 Node.js 版本。
$ cd ~ && curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
Or
$ cd ~ && wget -qO- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash| import random | |
| class DistributedSampler: | |
| def __init__(self, dataset_size, world_size, rank, | |
| shuffle=True, seed=0): | |
| self.dataset_size = dataset_size | |
| self.world_size = world_size | |
| self.rank = rank |
| """ | |
| A distributed sampler | |
| """ | |
| import math | |
| import random | |
| class DistributedSampler: | |
| def __init__( |
| # %% | |
| # -*- coding: utf-8 -*- | |
| """ | |
| distributed dataloader | |
| """ | |
| import heapq | |
| import time | |
| import random |
| def MultiHeadAttention(nn.Module): | |
| def __init__(self, n_heads: int, head_size: int): | |
| """Init attention module | |
| Args: | |
| n_heads (int): Number of query, key and value heads. | |
| head_size (int): Dimension size of each attention head. | |
| """ | |
| super(MultiHeadAttention, self).__init__() | |
| self.n_heads = n_heads |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| #!/usr/bin/env bash | |
| #============================================================================== | |
| # Install Mac OS X GUI Application via brew cask | |
| #============================================================================== | |
| brew cask install google-chrome | |
| brew cask install thunderbird | |
| brew cask install dropbox | |
| brew cask install copy | |
| brew cask install slack | |
| brew cask install the-unarchiver |