SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.09408 · NeurIPS · 2021

HRFormer: High-Resolution Transformer for Dense Prediction

Lang Huang, Chao Zhang, Jingdong Wang, Yuhui Yuan, Rao Fu, Weihong Lin, Xilin Chen

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2110.09408.json · badge: /api/ran/2110.09408.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
HRNet/HRFormer canonical (classifier label)
classifier basis: classifier_2025
7 ran · 4 no recorded run
FunctionStatusWhere it lives
Bottleneck Ran
ran on a synthesized input · constructed an object; no result was computed
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("70a3b60f25883442")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Bottleneck: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

BN_MOMENTUM = 0.1

class Bottleneck(nn.Module):
    expansion = 4

    def __init__(self, inplanes, planes, stride=1, downsample=None):
        super(Bottleneck, self).__init__()
        self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
        self.bn1 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM)
        self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=1, bias=False)
        self.bn2 = nn.BatchNorm2d(planes, momentum=BN_MOMENTUM)
        self.conv3 = nn.Conv2d(planes, planes * self.expansion, kernel_size=1, bias=False)
        self.bn3 = nn.BatchNorm2d(planes * self.expansion, momentum=BN_MOMENTUM)
        self.relu = nn.ReLU(inplace=True)
        self.downsample = downsample
        self.stride = stride

    def forward(self, x):
        residual = x
        out = self.conv1(x)
        out = self.bn1(out)
        out = self.relu(out)
        out = self.conv2(out)
        out = self.bn2(out)
        out = self.relu(out)
        out = self.conv3(out)
        out = self.bn3(out)
        if self.downsample is not None:
            residual = self.downsample(x)
        out += residual
        out = self.relu(out)
        return out

downsample_module = nn.Sequential(
    nn.Conv2d(8, 32, kernel_size=1, stride=1, bias=False),
    nn.BatchNorm2d(32, momentum=BN_MOMENTUM)
)

ARGS = {
    "inplanes": 8,
    "planes": 8,
    "stride": 1,
    "downsample": downsample_module
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Bottleneck — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Bottleneck output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
BottleneckDWP Ran
ran on a synthesized input · constructed an object; no result was computed
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("25d275a698577c77")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, BottleneckDWP: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal downsample module
# The downsample is called with x as input and needs to output a tensor
# with shape compatible for residual addition
downsample = nn.Sequential(
    nn.Conv2d(4, 16, kernel_size=1, stride=1, bias=False),
    nn.BatchNorm2d(16, momentum=0.1)
)

ARGS = {
    "inplanes": 4,
    "planes": 4,
    "stride": 1,
    "downsample": downsample
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BottleneckDWP — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BottleneckDWP output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
HighResolutionTransformerModule Ran
ran on a synthesized input · constructed an object; no result was computed
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("dc476e7863dfa60a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, HighResolutionTransformerModule: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create a minimal block class that satisfies the interface
class DummyBlock(nn.Module):
    expansion = 1
    
    def __init__(self, inplanes, planes, input_resolution=56, num_heads=8, 
                 window_size=7, mlp_ratio=4.0, attn_type='msa', ffn_type='mlp', 
                 drop_path=0.0, stride=1, downsample=None):
        super(DummyBlock, self).__init__()
        self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
        self.bn1 = nn.BatchNorm2d(planes)
        self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=1, bias=False)
        self.bn2 = nn.BatchNorm2d(planes)
        self.conv3 = nn.Conv2d(planes, planes * self.expansion, kernel_size=1, bias=False)
        self.bn3 = nn.BatchNorm2d(planes * self.expansion)
        self.relu = nn.ReLU(inplace=True)
        self.downsample = downsample
        self.stride = stride
    
    def forward(self, x):
        identity = x
        out = self.conv1(x)
        out = self.bn1(out)
        out = self.relu(out)
        out = self.conv2(out)
        out = self.bn2(out)
        out = self.relu(out)
        out = self.conv3(out)
        out = self.bn3(out)
        if self.downsample is not None:
            identity = self.downsample(x)
        out += identity
        out = self.relu(out)
        return out

# Define arguments for HighResolutionTransformerModule
num_branches = 2
num_blocks = [2, 2]
num_inchannels = [64, 128]
num_channels = [64, 128]
num_heads = [8, 8]
num_window_sizes = [7, 7]
num_mlp_ratios = [4.0, 4.0]
num_input_resolutions = [56, 28]
attn_types = [['msa', 'msa'], ['msa', 'msa']]
ffn_types = [['mlp', 'mlp'], ['mlp', 'mlp']]
drop_paths = [0.0, 0.0]

ARGS = {
    'num_branches': num_branches,
    'blocks': DummyBlock,
    'num_blocks': num_blocks,
    'num_inchannels': num_inchannels,
    'num_channels': num_channels,
    'num_heads': num_heads,
    'num_window_sizes': num_window_sizes,
    'num_mlp_ratios': num_mlp_ratios,
    'num_input_resolutions': num_input_resolutions,
    'attn_types': attn_types,
    'ffn_types': ffn_types,
    'multi_scale_output': True,
    'drop_paths': drop_paths,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type HighResolutionTransformerModule — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a HighResolutionTransformerModule output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
LocalPermuteModule Ran
ran on a synthesized input · constructed an object; no result was computed
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("f3ae82b7f0fa5762")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LocalPermuteModule: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from timm.models.layers import to_2tuple

torch.manual_seed(0)

ARGS = {
    "local_group_size": 7
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LocalPermuteModule — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LocalPermuteModule output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
MlpDWBN Ran
ran on a synthesized input · constructed an object; no result was computed
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("7511c8343dacb63e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, MlpDWBN: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define ARGS dict with all parameters for MlpDWBN
ARGS = {
    'in_features': 4,
    'hidden_features': 8,
    'out_features': 4,
    'act_layer': nn.GELU,
    'dw_act_layer': nn.GELU,
    'drop': 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MlpDWBN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MlpDWBN output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
MultiheadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("7f956321be67f123")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, MultiheadAttention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Minimal setup for MultiheadAttention
embed_dim = 8
num_heads = 2
kdim = 8
vdim = 8

ARGS = {
    'embed_dim': embed_dim,
    'num_heads': num_heads,
    'dropout': 0.1,
    'bias': True,
    'add_bias_kv': False,
    'add_zero_attn': False,
    'kdim': kdim,
    'vdim': vdim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MultiheadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiheadAttention output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PadBlock Ran
ran on a synthesized input · constructed an object; no result was computed
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("f1a2da4545324be4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, PadBlock: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math
from timm.models.layers import to_2tuple

torch.manual_seed(0)

ARGS = {
    "local_group_size": 7
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PadBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PadBlock output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
GeneralTransformerBlock Not yet run
unverified (harvested, no recorded run)
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("174ded5efb8d90bb")
How it ran

no invocation recorded.

HighResolutionTransformer Not yet run
unverified (harvested, no recorded run)
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("a219e0495156d384")
How it ran

no invocation recorded.

MultiheadAttentionRPE Not yet run
unverified (harvested, no recorded run)
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("77bb6724a9d5ee58")
How it ran

no invocation recorded.

MultiheadISAAttention Not yet run
unverified (harvested, no recorded run)
HRNet/HRFormer/cls/models/hrt.py
code served (permissive licence) · get_code("dd8ca007aa495f2f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
Bottleneck
brick of this paper's assembly: helper
4 other papers
2 dated earlier, 2 later · 3 only as an assembly brick
2103.07254 (2021-03)
Deep Dual Consecutive Network for Human Pose Estimation
2107.02156 (2021-07)
Do Different Tracking Tasks Require Different Appearance Models?
2303.11726 (2023-03)
3D Human Mesh Estimation from Virtual Markers
and 1 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We present a High-Resolution Transformer (HRFormer) that learns high-resolution representations for dense prediction tasks, in contrast to the original Vision Transformer that produces low-resolution representations and has high memory and computational cost. We take advantage of the multi-resolution parallel design introduced in high-resolution convolutional networks (HRNet [46]), along with local-window self-attention that performs self-attention over small non-overlapping image windows [21], for improving the memory and computation efficiency. In addition, we introduce a convolution into the FFN to exchange information across the disconnected image windows. We demonstrate the effectiveness of the High-Resolution Transformer on both human pose estimation and semantic segmentation tasks, e.g., HRFormer outperforms Swin transformer [27] by 1.3 AP on COCO pose estimation with 50% fewer parameters and 30% fewer FLOPs. Code is available at: https://github.com/HRNet/HRFormer.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2110.09408")
get_code_for_paper("2110.09408")
have("2110.09408")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2110.09408.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2110.09408.svg)](https://syntology.ai/paper/2110.09408)

Connect an agent — have() is free.