Skip to content

Instantly share code, notes, and snippets.

View NormXU's full-sized avatar
🎯
Pixels Do Think Like Text.

Norm Inui NormXU

🎯
Pixels Do Think Like Text.
View GitHub Profile
@NormXU
NormXU / hook_pth.py
Created February 10, 2024 06:32 — forked from raytroop/hook_pth.py
try hook of pytorch
import torch
from torch import nn
# 1.
# register_forward_pre_hook(hook)
# The hook will be called every time before forward() is invoked. It should have the following signature:
# `hook(module, input) -> None`
# The hook should not modify the input
@NormXU
NormXU / wsl-cheatsheet.ps1
Created November 16, 2023 17:20 — forked from karthiks/wsl-cheatsheet.ps1
WSL 2 CLI Cheat-sheet To Be Run In Powershell
# To list installed distributions
wsl -l
wsl --list
# To list installed distributions along with its running status and wsl config being 1 or 2
wsl -l --verbose
wsl -l -v
# To run a specific distro
wsl -d distro_name