Skip to content

Instantly share code, notes, and snippets.

@trzy
trzy / .gitconfig
Created June 21, 2024 22:12
Git log format: single line
[alias]
lg = log --format='%C(auto)%h %d (%C(cyan)%ad%C(auto)) %C(red)%an%C(auto) %s' --graph --all --date=format:'%Y-%m-%d %H:%M:%S'
@trzy
trzy / memory_leak.py
Created January 19, 2022 21:33
PyTorch Memory Leak and Redundant .detach()
This file has been truncated, but you can view the full file.
from dataclasses import dataclass
import numpy as np
import random
import torch as t
from torch import nn
from torchvision.ops import nms
from torch.nn import functional as F
from torchvision.ops import RoIPool