SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2102.12122 · ICCV · 2021

Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions

Ping Luo, Ling Shao, Enze Xie, Wenhai Wang, Ding Liang, Kaitao Song, Tong Lu, Xiang Li, Conv, Deng-Ping Fan, Cls, Det

arXiv · PDF · Open in the Atlas

Code that ran

22 of 30 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (16 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 16 have no contract verdict; 4 failures of our instrument; 8 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2102.12122.json · badge: /api/ran/2102.12122.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
microsoft/vision-longformer community
Papers with Code archive
12 ran · 6 no recorded run
DarshanDeshpande/jax-models community
Papers with Code archive
5 ran · 2 no recorded run
whai362/PVT marked official in Papers with Code
Papers with Code archive
4 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
AdaptiveAveragePool2D Ran
ran on a synthesized input · constructed an object; no result was computed
DarshanDeshpande/jax-models/jax_models/models/pvit.py
code served (permissive licence) · get_code("4e79665da13fed0d")
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, AdaptiveAveragePool2D: 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 jax
import jax.numpy as jnp
import flax.linen as nn

# Create a minimal input tensor for AdaptiveAveragePool2D
# The function expects inputs with shape (batch, height, width, channels)
# We need dimensions that are divisible by the output_size for the split operations
batch_size = 2
height = 8
width = 8
channels = 4

# Create input tensor with shape (batch, height, width, channels)
inputs = jnp.ones((batch_size, height, width, channels))

# Test with tuple output_size
output_size_tuple = (2, 2)

# Test with int output_size
output_size_int = 2

ARGS = {
    "output_size": output_size_tuple,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AdaptiveAveragePool2D — 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 AdaptiveAveragePool2D 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
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
DarshanDeshpande/jax-models/jax_models/models/pvit.py
code served (permissive licence) · get_code("07fdb7e2bfa01afa")
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, Attention: 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 jax
import jax.numpy as jnp
import flax.linen as nn

# Set seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Create small test inputs
batch_size = 2
dim = 4
num_heads = 2
height = 8
width = 8
seq_length = height * width

# Create sample input tensor
key = jax.random.PRNGKey(0)
inputs = jax.random.normal(key, (batch_size, seq_length, dim))

ARGS = {
    'dim': dim,
    'num_heads': num_heads,
    'use_att_bias': False,
    'att_drop': 0.0,
    'proj_drop': 0.0,
    'sr_ratio': 1,
    'linear': False,
    'deterministic': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Attention — 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 Attention 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
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
whai362/PVT/classification/pvt.py
code served (permissive licence) · get_code("5dada1aeda7932eb")
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, Attention: 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)

# Create an instance of Attention to use as a parameter
dim = 8
num_heads = 2
qkv_bias = False
qk_scale = None
attn_drop = 0.1
proj_drop = 0.1
sr_ratio = 1

attention_module = nn.Module()

# Create sample input for forward pass
batch_size = 2
num_tokens = 4
channels = 8
height = 2
width = 2

x = torch.randn(batch_size, num_tokens, channels)
H = height
W = width

# Define ARGS dictionary with all parameters for Attention.__init__
ARGS = {
    "dim": 8,
    "num_heads": 2,
    "qkv_bias": False,
    "qk_scale": None,
    "attn_drop": 0.1,
    "proj_drop": 0.1,
    "sr_ratio": 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 Attention — 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 Attention 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
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("592e8438de425b53")
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, Attention: 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 torch import nn
from timm.models.layers import DropPath, trunc_normal_, to_2tuple

torch.manual_seed(0)

# Build ARGS dict with all parameters for Attention.__init__
ARGS = {
    'dim': 8,
    'num_heads': 2,
    'qkv_bias': False,
    'qk_scale': None,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
    'rpe': True,
    'wx': 3,
    'wy': 3,
    'nglo': 1,
}
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 Attention — 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 Attention 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
Block Ran
ran on a synthesized input · constructed an object; no result was computed
whai362/PVT/classification/pvt.py
code served (permissive licence) · get_code("583eadd9a5e6a087")
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, Block: 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
from timm.models.layers import DropPath

torch.manual_seed(0)

ARGS = {
    'dim': 4,
    'num_heads': 2,
    'mlp_ratio': 4.0,
    'qkv_bias': False,
    'qk_scale': None,
    'drop': 0.0,
    'attn_drop': 0.0,
    'drop_path': 0.0,
    'act_layer': nn.GELU,
    'norm_layer': nn.LayerNorm,
    'sr_ratio': 1,
}
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 Block — 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 Block 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
DepthwiseConv2D Ran
ran on a synthesized input · constructed an object; no result was computed
DarshanDeshpande/jax-models/jax_models/models/pvit.py
code served (permissive licence) · get_code("f523e66d872044ea")
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, DepthwiseConv2D: 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 jax
import jax.numpy as jnp
import flax.linen as nn
from typing import Sequence, Tuple, Callable, Optional, Union

# Set random seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Create a small input tensor for testing
# Shape: (batch=2, height=4, width=3, channels=2) in NHWC format
input_data = jnp.ones((2, 4, 3, 2), dtype=jnp.float32)

# Define ARGS dict with all parameters for DepthwiseConv2D
ARGS = {
    'kernel_shape': (3, 3),
    'stride': (1, 1),
    'padding': 'SAME',
    'channel_multiplier': 1,
    'use_bias': True,
    'weights_init': nn.initializers.lecun_uniform(),
    'bias_init': nn.initializers.zeros,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DepthwiseConv2D — 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 DepthwiseConv2D 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
FastAttention Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("da55353e88022d26")
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, FastAttention: 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 torch import nn
import math

torch.manual_seed(0)

ARGS = {
    'dim_heads': 4,
    'nb_features': 8,
    'ortho_scaling': 0,
    'generalized_attention': False,
    'kernel_fn': nn.ReLU(),
    'no_projection': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FastAttention — 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 FastAttention 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
LinformerSelfAttention Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("6ba11adb4f98f7ff")
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, LinformerSelfAttention: 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 torch import nn
import math

torch.manual_seed(0)

# Define ARGS dict with all parameters for LinformerSelfAttention
ARGS = {
    'dim': 8,
    'seq_len': 4,
    'num_feats': 2,
    'num_heads': 2,
    'qkv_bias': False,
    'qk_scale': None,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
    'share_kv': False,
}
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 LinformerSelfAttention — 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 LinformerSelfAttention 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
MlpBlock Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("0440cd3acf07c3c4")
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, MlpBlock: 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
from timm.models.layers import DropPath

torch.manual_seed(0)

# Define ARGS dict with all parameters for MlpBlock.__init__
ARGS = {
    'dim': 4,
    'out_dim': 3,
    'mlp_ratio': 4.0,
    'drop': 0.1,
    'drop_path': 0.1,
    'act_layer': nn.GELU,
    'norm_layer': nn.LayerNorm,
}
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 MlpBlock — 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 MlpBlock 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
OverlapPatchEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
DarshanDeshpande/jax-models/jax_models/models/pvit.py
code served (permissive licence) · get_code("df41558bed765430")
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, OverlapPatchEmbed: 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 jax
import jax.numpy as jnp
import flax.linen as nn

# Define the OverlapPatchEmbed class
class OverlapPatchEmbed(nn.Module):
    emb_dim: int = 768
    patch_size: int = 16
    stride: int = 4
    kernel_init: callable = nn.initializers.xavier_normal()

    @nn.compact
    def __call__(self, inputs):
        conv = nn.Conv(self.emb_dim, (self.patch_size, self.patch_size), self.stride, padding=((self.patch_size // 2, self.patch_size // 2), (self.patch_size // 2, self.patch_size // 2)), kernel_init=self.kernel_init, name='proj')(inputs)
        flat = jnp.reshape(conv, (conv.shape[0], -1, conv.shape[-1]))
        norm = nn.LayerNorm(name='norm')(flat)
        return norm

# Create small, distinct dimension sizes for testing
batch_size = 2
num_channels = 3
height = 32
width = 32
emb_dim = 4
patch_size = 4
stride = 2

# Create a small input tensor (batch, height, width, channels)
inputs = jnp.ones((batch_size, height, width, num_channels), dtype=jnp.float32)

# Define the kernel initializer
kernel_init = nn.initializers.xavier_normal()

# Construct ARGS dict with all parameters
ARGS = {
    "emb_dim": emb_dim,
    "patch_size": patch_size,
    "stride": stride,
    "kernel_init": kernel_init,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OverlapPatchEmbed — 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 OverlapPatchEmbed 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
PatchEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
whai362/PVT/classification/pvt.py
code served (permissive licence) · get_code("916b4f73572180ec")
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, PatchEmbed: 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
from timm.models.layers import DropPath, to_2tuple, trunc_normal_

torch.manual_seed(0)

# PatchEmbed constructor parameters:
# img_size=224, patch_size=16, in_chans=3, embed_dim=768

ARGS = {
    "img_size": 224,
    "patch_size": 16,
    "in_chans": 3,
    "embed_dim": 768,
}
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 PatchEmbed — 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 PatchEmbed 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
PatchEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("b8071a3c02db7b92")
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, PatchEmbed: 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
from timm.models.layers import trunc_normal_, to_2tuple

torch.manual_seed(0)

# Build a minimal norm_layer that works like LayerNorm
norm_layer = nn.LayerNorm

# Create a small valid input tensor
# Shape: (batch=2, in_chans=3, height=8, width=8)
# This will be projected to patches, so we need height/patch_size = nx and width/patch_size = ny
x = torch.randn(2, 3, 8, 8)
nx = 4  # height after patching (8 / patch_size=2)
ny = 4  # width after patching (8 / patch_size=2)

# Create the input tuple that forward() expects
xtuple = (x, nx, ny)

ARGS = {
    'patch_size': 2,
    'nx': 4,
    'ny': 4,
    'in_chans': 3,
    'embed_dim': 8,
    'nglo': 1,
    'norm_layer': nn.LayerNorm,
    'norm_embed': True,
    'drop_rate': 0.1,
    'ape': True,
}
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 PatchEmbed — 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 PatchEmbed 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
PyramidVisionTransformer Ran
ran on a synthesized input · constructed an object; no result was computed
whai362/PVT/classification/pvt.py
code served (permissive licence) · get_code("c69b1b1a3052ca98")
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, PyramidVisionTransformer: 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
from timm.models.layers import DropPath, to_2tuple, trunc_normal_

torch.manual_seed(0)

# The function is incomplete in the provided code, but we can construct
# valid arguments for PyramidVisionTransformer based on its __init__ signature

ARGS = {
    "img_size": 224,
    "patch_size": 16,
    "in_chans": 3,
    "num_classes": 1000,
    "embed_dims": [64, 128, 256, 512],
    "num_heads": [1, 2, 4, 8],
    "mlp_ratios": [4, 4, 4, 4],
    "qkv_bias": False,
    "qk_scale": None,
    "drop_rate": 0.0,
    "attn_drop_rate": 0.0,
    "drop_path_rate": 0.0,
    "norm_layer": nn.LayerNorm,
    "depths": [3, 4, 6, 3],
    "sr_ratios": [8, 4, 2, 1],
    "num_stages": 4,
}
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 PyramidVisionTransformer — 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 PyramidVisionTransformer 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
SRSelfAttention Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("e41b50defb828842")
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, SRSelfAttention: 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 torch import nn

torch.manual_seed(0)

# Define test arguments for SRSelfAttention
ARGS = {
    'dim': 8,
    'rratio': 2,
    'num_heads': 2,
    'qkv_bias': False,
    'qk_scale': None,
    'attn_drop': 0.1,
    'proj_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 SRSelfAttention — 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 SRSelfAttention 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
SlidingChunk2D Ran
ran on a synthesized input · constructed an object; no result was computed
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("46bc17ff8a5ba939")
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, SlidingChunk2D: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Based on the function signature and usage, we need to construct:
# - q_img: (B * H, M, mx, my, W**2)
# - k_img: (B * H, M, mx, my, W**2)
# - v_img: (B * H, M, mx, my, W**2)
# - attn: (B * H, mx, my, W**2, 9*W**2) or (B * H, mx, my, W**2, W**2) or (B * H, mx, my, W**2, 2*W**2)
# - grad_x: (B * H, M, mx, my, W**2)
# - mode: int in range [-1, 0, 1-8]

# Let's use small dimensions:
# B*H = 2 (batch * heads)
# M = 1 (some spatial dim)
# mx, my = 2, 3 (spatial grid dims)
# W**2 = 4 (window squared)

B_H = 2
M = 1
mx = 2
my = 3
W_squared = 4

# Create q_img tensor: (B*H, M, mx, my, W**2)
q_img = torch.randn(B_H, M, mx, my, W_squared)

# Create k_img tensor: (B*H, M, mx, my, W**2)
k_img = torch.randn(B_H, M, mx, my, W_squared)

# Create v_img tensor: (B*H, M, mx, my, W**2)
v_img = torch.randn(B_H, M, mx, my, W_squared)

# Create attn tensor for mode=0 (full): (B*H, mx, my, W**2, 9*W**2)
attn_full = torch.randn(B_H, mx, my, W_squared, 9 * W_squared)

# Create attn tensor for mode=-1 (self only): (B*H, mx, my, W**2, W**2)
attn_self = torch.randn(B_H, mx, my, W_squared, W_squared)

# Create attn tensor for mode=1-8 (self+block): (B*H, mx, my, W**2, 2*W**2)
attn_block = torch.randn(B_H, mx, my, W_squared, 2 * W_squared)

# Create grad_x tensor: (B*H, M, mx, my, W**2)
grad_x = torch.randn(B_H, M, mx, my, W_squared)

# Mode parameter
mode = 1

ARGS = {
    'q_img': q_img,
    'k_img': k_img,
    'v_img': v_img,
    'attn': attn_full,
    'grad_x': grad_x,
    'mode': mode,
}
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 SlidingChunk2D — 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 SlidingChunk2D 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
TransformerMLP Ran
ran on a synthesized input · constructed an object; no result was computed
DarshanDeshpande/jax-models/jax_models/models/pvit.py
code served (permissive licence) · get_code("374179113e51b201")
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, TransformerMLP: 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 jax
import jax.numpy as jnp
import flax.linen as nn
from typing import Callable, Optional, Sequence, Tuple, Union

# Set seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

ARGS = {
    'dim': 64,
    'out_dim': 32,
    'dropout': 0.1,
    'use_dwconv': False,
    'linear': False,
    'dense_kernel_init': nn.initializers.xavier_uniform(),
    'conv_kernel_init': nn.initializers.xavier_normal(),
    'deterministic': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TransformerMLP — 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 TransformerMLP 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
_get_invalid_locations_mask_cyclic Ran
ran; our contract draft was wrong, not the code
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("9e88f2b66f738494")
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 tuple. 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

torch.manual_seed(0)

ARGS = {
    "nx": 2,
    "ny": 3,
    "padx": 1,
    "pady": 1,
    "w": 2,
    "device": "cpu"
}
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 tuple — a tuple output has no array shape of its own; none is 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
_get_invalid_locations_mask_exact Ran
ran; our contract draft was wrong, not the code
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("813948d3f352d1c6")
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 tuple. 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

torch.manual_seed(0)

ARGS = {
    "nx": 3,
    "ny": 2,
    "padx": 1,
    "pady": 1,
    "w": 2,
    "device": "cpu",
}
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 tuple — a tuple output has no array shape of its own; none is 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
_get_invalid_locations_mask_zero Ran
ran; our contract draft was wrong, not the code
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("f48afe5b9c50d66c")
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 tuple. 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

torch.manual_seed(0)

ARGS = {
    "nx": 4,
    "ny": 3,
    "padx": 2,
    "pady": 1,
    "w": 2,
    "device": "cpu"
}
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 tuple — a tuple output has no array shape of its own; none is 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
gaussian_orthogonal_random_matrix Ran
ran, honoured the contract we drafted
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("1652fbb1719cc1b4")
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 Tensor, ndim 2, dtype family float, shape (8, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 scipy.stats import ortho_group

torch.manual_seed(0)

ARGS = {
    'nb_rows': 8,
    'nb_columns': 4,
    'scaling': 0,
    'device': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (8, 4) — shape (8, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
init_ Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from microsoft/vision-longformer
pointer only · get_code("3444251df88e6169")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

softmax_kernel Ran
ran; our contract draft was wrong, not the code
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("757aee54843af070")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 einops import rearrange, repeat

torch.manual_seed(0)

# Create small test tensors
batch_size = 2
num_heads = 3
seq_len = 4
feature_dim = 5
projection_dim = 6

# data: shape (b, h, seq_len, feature_dim)
data = torch.randn(batch_size, num_heads, seq_len, feature_dim)

# projection_matrix: shape (projection_dim, feature_dim)
projection_matrix = torch.randn(projection_dim, feature_dim)

ARGS = {
    'data': data,
    'projection_matrix': projection_matrix,
    'is_query': True,
    'normalize_data': True,
    'eps': 0.0001,
    'device': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 4, 6) — shape (2, 3, 4, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
AttnBlock Not yet run
unverified (harvested, no recorded run)
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("2de4320db751601f")
How it ran

no invocation recorded.

Block Not yet run
unverified (harvested, no recorded run)
DarshanDeshpande/jax-models/jax_models/models/pvit.py
code served (permissive licence) · get_code("3ec0d795856d98f3")
How it ran

no invocation recorded.

Long2DSCSelfAttention Not yet run
unverified (harvested, no recorded run)
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("c7c2414a1044ea7d")
How it ran

no invocation recorded.

MsViT Not yet run
unverified (harvested, no recorded run)
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("380e07f5bfb682af")
How it ran

no invocation recorded.

PerformerSelfAttention Not yet run
unverified (harvested, no recorded run)
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("53e595a68e74e8a6")
How it ran

no invocation recorded.

PyramidViT Not yet run
unverified (harvested, no recorded run)
DarshanDeshpande/jax-models/jax_models/models/pvit.py
code served (permissive licence) · get_code("5fad6fb95a0d420f")
How it ran

no invocation recorded.

mask_invalid_locations Not yet run
unverified (harvested, no recorded run)
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("b7a2d11b74ff36f6")
How it ran

no invocation recorded.

slidingchunk_2dautograd Not yet run
unverified (harvested, no recorded run)
microsoft/vision-longformer/src/models/msvit.py
code served (permissive licence) · get_code("56b6ba9dcdd328f4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 30 samples lifted from this paper's linked repositories, 30 carry a function identity and 0 do not. Of the 30 distinct functions with an identity, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 later) and 23 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
DepthwiseConv2D
brick of this paper's assembly: helper
5 other papers
5 later
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2105.01601 (2021-05)
MLP-Mixer: An all-MLP Architecture for Vision
2105.15203 (2021-05)
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
and 2 more not named here
TransformerMLP
brick of this paper's assembly: helper
4 other papers
4 later
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2105.01601 (2021-05)
MLP-Mixer: An all-MLP Architecture for Vision
2105.15203 (2021-05)
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
and 1 more not named here
init_
brick of this paper's assembly: helper
2 other papers
2 later
2103.15358 (2021-03)
Multi-Scale Vision Longformer: A New Vision Transformer for High-Resolution Image Encoding
2207.14676 (2022-07)
Global-Local Self-Distillation for Visual Representation Learning
softmax_kernel
brick of this paper's assembly: helper
2 other papers
2 later
2103.15358 (2021-03)
Multi-Scale Vision Longformer: A New Vision Transformer for High-Resolution Image Encoding
2207.14676 (2022-07)
Global-Local Self-Distillation for Visual Representation Learning
OverlapPatchEmbed
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2105.15203 (2021-05)
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
mask_invalid_locations
brick of this paper's assembly: helper
1 other paper
1 later
2103.15358 (2021-03)
Multi-Scale Vision Longformer: A New Vision Transformer for High-Resolution Image Encoding
slidingchunk_2dautograd
brick of this paper's assembly: helper
1 other paper
1 later
2103.15358 (2021-03)
Multi-Scale Vision Longformer: A New Vision Transformer for High-Resolution Image Encoding

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

TASK 1. CLS 2. DET 3. SEG ...

For agents

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

get_harvested_code_for_paper("2102.12122")
get_code_for_paper("2102.12122")
have("2102.12122")

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

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

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

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

Connect an agent — have() is free.