https://pypi.org/project/pyleargist/
Unix Instructions: http://www.fftw.org/fftw3_doc/Installation-on-Unix.html
| import argparse | |
| import os | |
| import shutil | |
| import time | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.parallel | |
| import torch.backends.cudnn as cudnn | |
| import torch.optim |
| # Sudoku Solver - Peter A. Norvig | |
| digits = '123456789' | |
| rows = 'ABCDEFGHI' | |
| cols = digits | |
| def cross(A, B): | |
| return [a+b for a in A for b in B] | |
| squares = cross(rows, cols) |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| git_current_branch () { | |
| local ref | |
| ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null) | |
| local ret=$? | |
| if [[ $ret != 0 ]] | |
| then | |
| [[ $ret == 128 ]] && return | |
| ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
| fi | |
| echo ${ref#refs/heads/} |
| import numpy as np | |
| from transformers import AutoTokenizer, AutoModel | |
| from pathlib import Path | |
| from optimum.exporters import TasksManager | |
| from optimum.exporters.onnx import export | |
| import onnx | |
| from optimum.exporters.onnx import validate_model_outputs | |
| from optimum.onnxruntime import ORTModelForFeatureExtraction | |
| import torch |