Skip to content

Instantly share code, notes, and snippets.

View nimanzik's full-sized avatar
🎧

Nima Nooshiri nimanzik

🎧
View GitHub Profile
@nimanzik
nimanzik / median_pool.py
Created December 19, 2022 18:34 — forked from rwightman/median_pool.py
PyTorch MedianPool (MedianFilter)
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair, _quadruple
class MedianPool2d(nn.Module):
""" Median pool (usable as median filter when stride=1) module.