SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.12723 · 2021

Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding

arXiv · PDF · Open in the Atlas

Code that ran

19 of 26 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 3 violated it and 5 have no contract verdict; 8 failures of our instrument; 7 no recorded run), measured 2026-11-23; 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/2105.12723.json · badge: /api/ran/2105.12723.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
google-research/nested-transformer canonical (classifier label)
classifier basis: census
9 ran · 3 no recorded run
freder-chen/vitp community (classifier label)
classifier basis not recorded on the link
9 ran · 4 no recorded run
conceptofmind/NesT-flax community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
adjust_learning_rate Ran
ran, honoured the contract we drafted
freder-chen/vitp/util/lr_sched.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from quandao10/slct, is pointer only (licence: NONE) · get_code("bd3578806ecf5ac2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from quandao10/slct, and GitHub detected no licence in that repository when it was checked. 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.

adjust_mask_ratio Ran
ran on a synthesized input
freder-chen/vitp/engine/scratch.py
code served (permissive licence) · get_code("d83a787ef8a41d29")
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 float, ndim 0, dtype family float, shape () 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 numpy as np

torch.manual_seed(0)

# Based on the function signature and body, we need:
# - epochs: int (total number of epochs)
# - epoch: int (current epoch, in range [0, epochs))
# - early_off: int (optional, defaults to 50)

ARGS = {
    "epochs": 100,
    "epoch": 25,
    "early_off": 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
all_reduce_mean Ran
ran, honoured the contract we drafted
freder-chen/vitp/util/misc.py
code served (permissive licence) · get_code("3dc19396537db789")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. 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, 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 torch.distributed as dist

torch.manual_seed(0)

# The function all_reduce_mean takes a single parameter 'x'
# Looking at the function body:
# - x is converted to a torch.tensor
# - If world_size > 1, it's moved to cuda and used with dist.all_reduce
# - Otherwise, x is returned as-is
# Since we're CPU-only and dist is not initialized, the function will return x unchanged
# We need to provide a numeric value that can be converted to a tensor

ARGS = {
    "x": 5.0
}
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 float, ndim 0, dtype family float, shape () — shape () 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
apply_label_smoothing Ran
ran, violated the contract we drafted
google-research/nested-transformer/libml/losses.py
code served (permissive licence) · get_code("08baacad242c29f2")
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 (2, 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 numpy as np

torch.manual_seed(0)

# Create one-hot targets tensor
# Shape: [batch_size=2, num_classes=4]
# Create valid one-hot encoded targets
one_hot_targets = torch.zeros(2, 4)
one_hot_targets[0, 0] = 1.0  # First sample, class 0
one_hot_targets[1, 2] = 1.0  # Second sample, class 2

# Label smoothing value
label_smoothing = 0.1

ARGS = {
    "one_hot_targets": one_hot_targets,
    "label_smoothing": label_smoothing,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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 (2, 4) — shape (2, 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
apply_weights Ran
ran, violated the contract we drafted
google-research/nested-transformer/libml/losses.py
code served (permissive licence) · get_code("d6d5db4678e1915c")
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 ArrayImpl, ndim 3, dtype family float, shape (2, 4, 3) 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 jax
import jax.numpy as jnp
import numpy as np

# Create sample data for the function
# output: nd-array of shape [batch_size, height, width] or similar
output = jnp.array(np.random.randn(2, 4, 3), dtype=jnp.float32)

# weights: nd-array of shape [batch_size,] or [batch_size, height, width]
# Per-example weights of shape [batch_size,]
weights = jnp.array(np.random.rand(2), dtype=jnp.float32)

ARGS = {
    "output": output,
    "weights": weights,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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
build_transform Ran
ran on a synthesized input
freder-chen/vitp/util/datasets.py
code served (permissive licence) · get_code("b86ebb0fa1909e0d")
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 Compose. 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 numpy as np
from PIL import Image
from torchvision import transforms

torch.manual_seed(0)

class ArgsStandIn:
    def __init__(self):
        self.mean = None
        self.std = None
        self.input_size = 224
        self.scale = (0.08, 1.0)
        self.ratio = (0.75, 1.333)
        self.color_jitter = 0.4
        self.aa = 'rand-m9-mstd0.5'
        self.reprob = 0.25
        self.remode = 'pixel'
        self.recount = 1
        self.dataset = 'imagenet'

args = ArgsStandIn()

ARGS = {
    'is_train': True,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, timm, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
cast_tuple Ran
ran, violated the contract we drafted
conceptofmind/NesT-flax/nest_flax.py/nest_flax.py
code served (permissive licence) · get_code("1f7c550e65142ef8")
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) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 = {
    "val": 42,
    "depth": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
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
checkpoint_filter_fn Ran
ran; our contract draft was wrong, not the code
freder-chen/vitp/models/swelling_vit.py
code served (permissive licence) · get_code("6d8a1f8a0697180f")
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 dict. 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 math

torch.manual_seed(0)

# Build a minimal model that checkpoint_filter_fn expects
class PatchEmbed(nn.Module):
    def __init__(self):
        super().__init__()
        # proj weight shape: (out_channels, in_channels, kernel_h, kernel_w)
        self.proj = nn.Conv2d(3, 16, kernel_size=4, stride=4)
        self.grid_size = [8, 8]  # 64x64 input -> 16x16 patches

class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.patch_embed = PatchEmbed()
        # pos_embed shape: (1, num_patches + num_tokens, embed_dim)
        # 64 patches (8x8 grid) + 1 cls token = 65 tokens
        self.pos_embed = nn.Parameter(torch.randn(1, 65, 12))
        self.num_tokens = 1

model = TinyModel()

# Create a state_dict to pass to checkpoint_filter_fn
state_dict = {
    'model': {
        'patch_embed.proj.weight': torch.randn(16, 3, 4, 4),
        'pos_embed': torch.randn(1, 65, 12),
        'other_param': torch.randn(2, 3),
    }
}

ARGS = {
    'state_dict': state_dict,
    'model': model,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
create_model Ran
ran; our contract draft was wrong, not the code
google-research/nested-transformer/models/resnet_v1.py
code served (permissive licence) · get_code("796c65138aa563c7")
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 partial. 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 functools
from typing import Any, List, Tuple, Type

class SimpleConfig:
    """Minimal config class for testing."""
    def __init__(self):
        self.learning_rate = 0.001
        self.batch_size = 2

ARGS = {
    "model_name": "resnet18",
    "config": SimpleConfig()
}
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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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
dense_layer_init_fn Ran
ran; our contract draft was wrong, not the code
google-research/nested-transformer/models/wide_resnet.py
code served (permissive licence) · get_code("6f6b06fdb24a7472")
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 ArrayImpl, ndim 2, dtype family float, shape (5, 3) 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 jax
from jax import numpy as jnp

# Set seed for reproducibility
key = jax.random.PRNGKey(42)

# Define shape: (input_dim, output_dim)
# Using distinct sizes: 5 for input, 3 for output
shape = (5, 3)

# Data type
dtype = jnp.float32

ARGS = {
    "key": key,
    "shape": shape,
    "dtype": dtype,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
generate_list Ran
ran on a synthesized input
freder-chen/vitp/models/swelling_vit.py
code served (permissive licence) · get_code("202b055d01574c6b")
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 list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 numpy as np

torch.manual_seed(0)

ARGS = {
    "start": 5,
    "num": 12,
    "step": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
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
get_hyper Ran
ran; our contract draft was wrong, not the code
google-research/nested-transformer/configs/resnet50_imagenet.py
code served (permissive licence) · get_code("ffc38a27fd9393ba")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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

class MockHyperparameter:
    def __init__(self):
        self.sweeps = {}
        self.products = []
    
    def sweep(self, name, values):
        """Create a sweep over values"""
        self.sweeps[name] = values
        return {name: values}
    
    def product(self, sweeps, name=None):
        """Create a product of sweeps"""
        result = []
        for sweep in sweeps:
            if isinstance(sweep, dict):
                for key, values in sweep.items():
                    for value in values:
                        result.append({key: value})
        return result

h = MockHyperparameter()

ARGS = {
    'h': h
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
get_layer_id_for_vit Ran
ran, honoured the contract we drafted
freder-chen/vitp/util/lr_decay.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from NikolaCenic/ecg-stenosis-cls, is pointer only (licence: NONE) · get_code("89edf5372214b57d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from NikolaCenic/ecg-stenosis-cls, and GitHub detected no licence in that repository when it was checked. 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.

param_groups_lrd Ran
ran; our contract draft was wrong, not the code
freder-chen/vitp/util/lr_decay.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from NikolaCenic/ecg-stenosis-cls, is pointer only (licence: NONE) · get_code("8baf25cef41cba16")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from NikolaCenic/ecg-stenosis-cls, and GitHub detected no licence in that repository when it was checked. 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.

random_apply Ran
ran on a synthesized input
google-research/nested-transformer/augment/color_util.py
code served (permissive licence) · get_code("d04f187058cb2a9c")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf

tf.disable_v2_behavior()

def simple_transform(x):
    """Simple transformation function that doubles the input."""
    return x * 2

# Create a small tensor
x = tf.constant([1.0, 2.0, 3.0, 4.0], dtype=tf.float32)

# Define probability
p = 0.7

# Define function to apply
func = simple_transform

ARGS = {
    "func": func,
    "p": p,
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
random_brightness Ran
ran on a synthesized input
google-research/nested-transformer/augment/color_util.py
code served (permissive licence) · get_code("e1aaf77a8784526a")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
import numpy as np

tf.disable_v2_behavior()

# Create a small image tensor
# Images are typically [height, width, channels]
image = tf.constant(np.random.rand(4, 3, 3).astype(np.float32))

# max_delta is a float controlling the brightness change range
max_delta = 0.2

# impl is a string specifying the implementation
impl = 'simclrv2'

ARGS = {
    'image': image,
    'max_delta': max_delta,
    'impl': impl
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
register Ran
ran; our contract draft was wrong, not the code
google-research/nested-transformer/models/nest_net.py
code served (permissive licence) · get_code("103f46a75894451d")
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 function. 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)

# The register function takes a single parameter 'f' which should be a callable
# (typically a function or class) that will be registered in the MODELS dict
# The function uses f.__name__ to get the name and stores f as the value

def dummy_model_factory():
    """A simple callable that could be registered"""
    return nn.Linear(4, 3)

class DummyClass:
    """A simple class that could be registered"""
    def __init__(self):
        self.value = 42

def sample_function(x):
    """A simple function that could be registered"""
    return x * 2

# Test with a function
ARGS = {
    'f': sample_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
resize_pos_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
freder-chen/vitp/models/swelling_vit.py
code served (permissive licence) · get_code("191b2735955d18f4")
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 3, dtype family float, shape (1, 17, 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

torch.manual_seed(0)

# The function resizes positional embeddings from one shape to another
# posemb: original position embeddings tensor (batch_size, num_tokens, embedding_dim)
# posemb_new: target position embeddings tensor with desired shape
# num_tokens: number of special tokens (like cls token) to preserve
# gs_new: target grid size (height, width) for the spatial part

# Create small test tensors
embedding_dim = 4
num_special_tokens = 1
old_grid_size = 3  # 3x3 = 9 spatial tokens
old_total_tokens = num_special_tokens + (old_grid_size * old_grid_size)  # 1 + 9 = 10

# Original position embedding: (batch=1, num_tokens=10, embedding_dim=4)
posemb = torch.randn(1, old_total_tokens, embedding_dim)

# New position embedding target shape
new_grid_size = 4  # 4x4 = 16 spatial tokens
new_total_tokens = num_special_tokens + (new_grid_size * new_grid_size)  # 1 + 16 = 17
posemb_new = torch.randn(1, new_total_tokens, embedding_dim)

# Grid size for new embedding (4x4 spatial grid)
gs_new = [4, 4]

ARGS = {
    'posemb': posemb,
    'posemb_new': posemb_new,
    'num_tokens': num_special_tokens,
    'gs_new': gs_new,
}
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 Tensor, ndim 3, dtype family float, shape (1, 17, 4) — shape (1, 17, 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
weighted_unnormalized_softmax_cross_entropy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google-research/nested-transformer/libml/losses.py
code served (permissive licence) · get_code("a70cd69707274f4d")
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 ArrayImpl, ndim 2, dtype family float, shape (2, 3) 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 jax
import jax.numpy as jnp
import flax.linen as nn

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

# Define dimensions with distinct sizes
batch_size = 2
num_classes = 4
spatial_dim = 3

# Create logits: [batch, spatial_dim, num_classes]
logits = jnp.ones((batch_size, spatial_dim, num_classes), dtype=jnp.float32) * 0.5

# Create one-hot targets: [batch, spatial_dim, num_classes]
one_hot_targets = jnp.zeros((batch_size, spatial_dim, num_classes), dtype=jnp.float32)
one_hot_targets = one_hot_targets.at[0, 0, 0].set(1.0)
one_hot_targets = one_hot_targets.at[0, 1, 1].set(1.0)
one_hot_targets = one_hot_targets.at[1, 0, 2].set(1.0)
one_hot_targets = one_hot_targets.at[1, 2, 3].set(1.0)

# Create weights: [batch, spatial_dim]
weights = jnp.array([[1.0, 1.0, 0.5], [1.0, 0.0, 1.0]], dtype=jnp.float32)

# Create label_weights: [num_classes]
label_weights = jnp.array([1.0, 1.2, 0.8, 1.1], dtype=jnp.float32)

# Label smoothing value
label_smoothing = 0.1

# Logits normalized flag
logits_normalized = False

ARGS = {
    'logits': logits,
    'one_hot_targets': one_hot_targets,
    'weights': weights,
    'label_smoothing': label_smoothing,
    'label_weights': label_weights,
    'logits_normalized': logits_normalized,
}
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 ArrayImpl, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
activation Not yet run
unverified (harvested, no recorded run)
google-research/nested-transformer/models/wide_resnet.py
code served (permissive licence) · get_code("3523de76ecdc1efc")
How it ran

no invocation recorded.

build_dataset Not yet run
unverified (harvested, no recorded run)
freder-chen/vitp/util/datasets.py
code served (permissive licence) · get_code("11d1d6883016bc0a")
How it ran

no invocation recorded.

create_model Not yet run
unverified (harvested, no recorded run)
google-research/nested-transformer/models/wide_resnet.py
code served (permissive licence) · get_code("13ce18ddacc0988a")
How it ran

no invocation recorded.

get_1d_sincos_pos_embed_from_grid Not yet run
unverified (harvested, no recorded run)
freder-chen/vitp/util/pos_embed.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zhangyifei01/LMIM, is pointer only (licence: NONE) · get_code("12035a2f77d8016c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from zhangyifei01/LMIM, and GitHub detected no licence in that repository when it was checked. 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. No invocation recorded.

get_2d_sincos_pos_embed Not yet run
unverified (harvested, no recorded run)
freder-chen/vitp/util/pos_embed.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yunongLiu1/IKEA-Manuals-at-Work, is pointer only (licence: NONE) · get_code("3185afc3e87293ed")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from yunongLiu1/IKEA-Manuals-at-Work, and GitHub detected no licence in that repository when it was checked. 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. No invocation recorded.

get_2d_sincos_pos_embed_from_grid Not yet run
unverified (harvested, no recorded run)
freder-chen/vitp/util/pos_embed.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zhangyifei01/LMIM, is pointer only (licence: NONE) · get_code("f10004e059714d42")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from zhangyifei01/LMIM, and GitHub detected no licence in that repository when it was checked. 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. No invocation recorded.

to_grayscale Not yet run
unverified (harvested, no recorded run)
google-research/nested-transformer/augment/color_util.py
code served (permissive licence) · get_code("49c827442d2fb761")
How it ran

no invocation recorded.

Also present in other papers' code

Of 26 samples lifted from this paper's linked repositories, 26 carry a function identity and 0 do not. Of the 26 distinct functions with an identity, 15 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 15 later) and 11 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
get_2d_sincos_pos_embed_from_grid 190 other papers
1 dated earlier, 189 later · 65 only as an assembly brick
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
2111.06377 (2021-11)
Masked Autoencoders Are Scalable Vision Learners
2202.00660 (2022-02)
Interactron: Embodied Adaptive Object Detection
and 187 more not named here
get_2d_sincos_pos_embed 95 other papers
1 dated earlier, 94 later · 33 only as an assembly brick
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
2111.06377 (2021-11)
Masked Autoencoders Are Scalable Vision Learners
2202.00660 (2022-02)
Interactron: Embodied Adaptive Object Detection
and 92 more not named here
get_1d_sincos_pos_embed_from_grid 39 other papers
39 later · 25 only as an assembly brick
2111.06377 (2021-11)
Masked Autoencoders Are Scalable Vision Learners
2204.09435 (2022-04)
Hephaestus: A large scale multitask dataset towards InSAR understanding
2206.00272 (2022-06)
Vision GNN: An Image is Worth Graph of Nodes
and 36 more not named here
checkpoint_filter_fn 37 other papers
37 later · 1 only as an assembly brick
2112.07658 (2021-12)
AdaViT: Adaptive Tokens for Efficient Vision Transformer
2202.07800 (2022-02)
Not All Patches are What You Need: Expediting Vision Transformers via Token Reorganizations
and 34 more not named here
all_reduce_mean 25 other papers
25 later
2204.09435 (2022-04)
Hephaestus: A large scale multitask dataset towards InSAR understanding
2211.12941 (2022-11)
EurNet: Efficient Multi-Range Relational Modeling of Spatial Multi-Relational Data
2301.11445 (2023-01)
3DShape2VecSet: A 3D Shape Representation for Neural Fields and Generative Diffusion Models
and 22 more not named here
adjust_learning_rate 23 other papers
23 later
2204.09435 (2022-04)
Hephaestus: A large scale multitask dataset towards InSAR understanding
2206.07699 (2022-06)
Write and Paint: Generative Vision-Language Models are Unified Modal Learners
2212.00776 (2022-12)
ResFormer: Scaling ViTs with Multi-Resolution Training
and 20 more not named here
resize_pos_embed 20 other papers
20 later · 1 only as an assembly brick
Chen_TransMix_Attend_To_Mix_for_Vision_Transformers_CVPR_2022_paper (2022 (year only))
TransMix: Attend to Mix for Vision Transformers
2202.07800 (2022-02)
Not All Patches are What You Need: Expediting Vision Transformers via Token Reorganizations
2203.13167 (2022-03)
Towards Exemplar-Free Continual Learning in Vision Transformers: an Account of Attention, Functional and Weight Regularization
and 17 more not named here
param_groups_lrd 14 other papers
14 later
2211.12941 (2022-11)
EurNet: Efficient Multi-Range Relational Modeling of Spatial Multi-Relational Data
aaai_25300 (2023 (year only))
Exploring Stochastic Autoregressive Image Modeling for Visual Representation
2301.11445 (2023-01)
3DShape2VecSet: A 3D Shape Representation for Neural Fields and Generative Diffusion Models
and 11 more not named here
get_layer_id_for_vit 13 other papers
13 later
aaai_25300 (2023 (year only))
Exploring Stochastic Autoregressive Image Modeling for Visual Representation
2301.11445 (2023-01)
3DShape2VecSet: A 3D Shape Representation for Neural Fields and Generative Diffusion Models
2304.03284 (2023-04)
SegGPT: Segmenting Everything In Context
and 10 more not named here
cast_tuple 7 other papers
1 dated earlier, 1 the same month, 5 later · 1 only as an assembly brick
2102.13419 (2021-02)
Iterative SE(3)-Transformers
2105.15203 (2021-05)
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
2111.09883 (2021-11)
Swin Transformer V2: Scaling Up Capacity and Resolution
and 4 more not named here
random_apply 4 other papers
1 dated earlier, 3 later
2006.05576 (2020-06)
Self-supervised Learning from a Multi-view Perspective
2108.10310 (2021-08)
Ranking Models in Unlabeled New Environments
2112.11435 (2021-12)
Learned Queries for Efficient Local Attention
and 1 more not named here
to_grayscale 4 other papers
1 dated earlier, 3 later
2006.05576 (2020-06)
Self-supervised Learning from a Multi-view Perspective
2108.10310 (2021-08)
Ranking Models in Unlabeled New Environments
2109.12909 (2021-09)
Compressive Visual Representations
and 1 more not named here
get_hyper 3 other papers
3 later
2302.05496 (2023-02)
MaskSketch: Unpaired Structure-guided Masked Image Generation
2306.04675 (2023-06)
Exposing flaws of generative model evaluation metrics and their unfair treatment of diffusion models
2311.16432 (2023-11)
Text-Driven Image Editing via Learnable Regions
random_brightness 2 other papers
2 later
2108.10310 (2021-08)
Ranking Models in Unlabeled New Environments
2112.11435 (2021-12)
Learned Queries for Efficient Local Attention
register 1 other paper
1 later
2112.11435 (2021-12)
Learned Queries for Efficient Local Attention

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-23.

Repositories linked to this paper

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

Abstract

Hierarchical structures are popular in recent vision transformers, however, they require sophisticated designs and massive datasets to work well. In this paper, we explore the idea of nesting basic local transformers on non-overlapping image blocks and aggregating them in a hierarchical way. We find that the block aggregation function plays a critical role in enabling cross-block non-local information communication. This observation leads us to design a simplified architecture that requires minor code changes upon the original vision transformer. The benefits of the proposed judiciously-selected design are threefold: (1) NesT converges faster and requires much less training data to achieve good generalization on both ImageNet and small datasets like CIFAR; (2) when extending our key ideas to image generation, NesT leads to a strong decoder that is 8$\times$ faster than previous transformer-based generators; and (3) we show that decoupling the feature learning and abstraction processes via this nested hierarchy in our design enables constructing a novel method (named GradCAT) for visually interpreting the learned model. Source code is available https://github.com/google-research/nested-transformer.

For agents

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

get_harvested_code_for_paper("2105.12723")
get_code_for_paper("2105.12723")
have("2105.12723")

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

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

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

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

Connect an agent — have() is free.