Skip to content

Instantly share code, notes, and snippets.

@Kallolarout
Kallolarout / median_pool.py
Created January 15, 2021 15: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.