timeit
applied to various Pytorch activation function on CPU and GPU, on a tensor of shape (20000,)
You must run this in a IPython session. Pytorch version is 2.0.0+cu117
.
See run.py
.
{ | |
"cmd": ["pandoc --latex-engine=xelatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name'"], | |
"selector": "text.html.markdown", | |
"shell": true | |
} |
@profile | |
def func1(i: float): | |
import time | |
time.sleep(i) | |
@profile | |
def func_mother(): | |
func1(1.2) | |
a = 2 + 3 |
import torch | |
import datasets | |
class HFDataset(torch.utils.data.Dataset): | |
def __init__(self, dset: datasets.Dataset): | |
self.dset = dset | |
def __getitem__(self, idx): | |
return self.dset[idx] |
%pip install pure-python-adb imageio | |
from ppadb.client import Client as AdbClient | |
# plug your android device with USB debugging | |
client = AdbClient(host="127.0.0.1", port=5037) | |
device = client.devices()[0] | |
screencap = device.screencap() |
# Lines configured by zsh-newuser-install | |
HISTFILE=~/.histfile | |
HISTSIZE=100000 | |
SAVEHIST=100000 | |
setopt extendedglob | |
unsetopt autocd | |
bindkey -e | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall |
Pop!_OS does not turn off your screen when you lock your screen. Where you hit tue Super+L
shortcut, it seems to start
some screensaver which display a black image and coincidently lock your session. But the screen itself does not go to
its standby mode.
Here is my solution:
<Super>l
shortcut occurences:
{dconf dump / ; gsettings list-recursively } | less
dconf-editor
to unset themfrom fast_flask import Flask | |
app = Flask(__name__) | |
@app.get("/users/") # equivalent to `@app.route("/users/")` from flask.Flask | |
def get_user_details(user_id: int = 123): | |
return {"123": "bob"} | |
if __name__ == "__main__": |