SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.16025 · CVPR · 2023

NVTC: Nonlinear Vector Transform Coding

Zhibo Chen, Zongyu Guo, Weiping Li, Runsen Feng

arXiv · PDF · Open in the Atlas

Code that ran

15 of 23 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; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 6 failures of our instrument; 8 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/2305.16025.json · badge: /api/ran/2305.16025.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
ustc-imcl/nvtc marked official in Papers with Code
Papers with Code archive
15 ran · 8 no recorded run
FunctionStatusWhere it lives
BlockCombination Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("42f45818dcda6125")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 8, 12) 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 torch.nn as nn

class BlockCombination(nn.Module):
    """Spatially combines blocks into a large tensor.
    The reverse process of BlockPartition.
    (b * n_block, c, h_block, w_block) -> (b, c, h, w)
    """

    def __init__(self, h_block: int, w_block: int):
        super().__init__()
        self.h_block = h_block
        self.w_block = w_block

    def forward(self, x, output_size):
        hb, wb = (self.h_block, self.w_block)
        h, w = output_size
        c = x.shape[1]
        assert h % hb == 0, w % wb == 0
        x = x.view(-1, h // hb, w // wb, c, hb, wb)
        x = x.permute(0, 3, 1, 4, 2, 5).contiguous()
        x = x.view(-1, c, h, w)
        return x


INIT_ARGS = {
    'h_block': 4,
    'w_block': 6,
}

ARGS = {
    'x': torch.randn(8, 3, 4, 6),
    'output_size': (8, 12),
}

if __name__ == '__main__':
    module = BlockCombination(**INIT_ARGS)
    output = module(**ARGS)
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float, shape (2, 3, 8, 12) — shape (2, 3, 8, 12) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
BlockPartition Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("866dd1e7632c183b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (8, 5, 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 torch
import torch.nn as nn

class BlockPartition(nn.Module):
    """Spatially partitions the input tensor into blocks.
    (b, c, h, w) -> (b * n_block, c, h_block, w_block)
    """

    def __init__(self, h_block: int, w_block: int):
        super().__init__()
        self.h_block = h_block
        self.w_block = w_block

    def forward(self, x):
        hb, wb = (self.h_block, self.w_block)
        b, c, h, w = x.shape
        n_block = h // hb * w // wb
        assert h % hb == 0, w % wb == 0
        x = x.view(b, c, h // hb, hb, w // wb, wb)
        x = x.permute(0, 2, 4, 1, 3, 5).contiguous()
        x = x.view(b * n_block, c, hb, wb)
        return x


INIT_ARGS = {
    'h_block': 4,
    'w_block': 3,
}

ARGS = {
    'x': torch.randn(2, 5, 8, 6),
}

if __name__ == '__main__':
    module = BlockPartition(**INIT_ARGS)
    output = module(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Expected output shape: (2 * (8//4) * (6//3), 5, 4, 3) = (8, 5, 4, 3)")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float, shape (8, 5, 4, 3) — shape (8, 5, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ChannelFC Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("1e3f7d811fa0ec89")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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
import torch.nn as nn

# INIT_ARGS: parameters for ChannelFC.__init__
INIT_ARGS = {
    'in_channels': 3,
    'hid_channels': 8,
    'out_channels': 5
}

# ARGS: parameters for ChannelFC.forward
# Input should be a 4D tensor: (batch, channels, height, width)
# The channels dimension must match in_channels=3
ARGS = {
    'x': torch.randn(2, 3, 7, 7)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ConditionalVectorQuantization Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("51240e3e520da518")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
import torch.nn as nn

class ConditionalVectorQuantization(nn.Module):

    def __init__(self):
        super().__init__()

    def l2_dist(self, x, code_book):
        x = x.unsqueeze(-1)
        dist = x.pow(2).sum(dim=-2) + code_book.pow(2).sum(dim=-1)
        dist = dist - 2 * torch.einsum('abc,dac->dab', code_book, x.squeeze(-1))
        return dist

    def forward(self, x, code_book, rate_bias=None):
        """
        Args:
            x: (n, *, dim)
            code_book: (*, cb_size, dim)
            rate_bias: (n, )[optional] + (*, cb_size)
        Return:
            x_hat: (n, *, dim)
            one_hot: (n, *, cb_size)
            dist: (n, *, cb_size)
        """
        dist = self.l2_dist(x, code_book)
        if rate_bias is not None:
            dist = rate_bias + dist
        index = dist.argmin(dim=-1, keepdim=True)
        one_hot = torch.zeros_like(dist)
        one_hot = one_hot.scatter_(-1, index, 1.0)
        x_hat = torch.einsum('abc,bcd->abd', one_hot, code_book)
        return (x_hat, one_hot, index)

    def compress(self, x, code_book, rate_bias=None):
        dist = self.l2_dist(x, code_book)
        if rate_bias is not None:
            dist = rate_bias + dist
        index = dist.argmin(dim=-1, keepdim=True)
        one_hot = torch.zeros_like(dist)
        one_hot = one_hot.scatter_(-1, index, 1.0)
        x_hat = torch.einsum('abc,bcd->abd', one_hot, code_book)
        return (x_hat, one_hot, index)

    def decompress(self, index, code_book):
        one_hot = torch.zeros(*index.shape[:2], code_book.shape[1], device=code_book.device)
        one_hot = one_hot.scatter_(-1, index.to(one_hot.device), 1.0)
        x_hat = torch.einsum('abc,bcd->abd', one_hot, code_book)
        return x_hat


INIT_ARGS = {}

ARGS = {
    'x': torch.randn(2, 3, 4),
    'code_book': torch.randn(3, 5, 4),
    'rate_bias': torch.randn(2, 3, 5)
}

if __name__ == '__main__':
    model = ConditionalVectorQuantization(**INIT_ARGS)
    x_hat, one_hot, index = model(**ARGS)
    print("x_hat shape:", x_hat.shape)
    print("one_hot shape:", one_hot.shape)
    print("index shape:", index.shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DepthwiseBlockFC Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("1972d3181390136e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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
import torch.nn as nn
import math

# INIT_ARGS: C (number of channels), b (block size)
INIT_ARGS = {
    'C': 3,
    'b': 2
}

# For forward method:
# x should have shape that when flattened over last 2 dims gives b*b elements
# Looking at the forward: x.unsqueeze(1) adds dim, then flatten(start_dim=-2)
# So x should have shape (..., b, b) to work with the weight (C, b^2, b^2)
# The einsum 'bacn,cnm->bacm' suggests:
#   - b: batch
#   - a: added dimension from unsqueeze(1) 
#   - c: channels (C)
#   - n: flattened spatial (b^2)
# So input x should have shape (batch, C, b, b)

ARGS = {
    'x': torch.randn(2, 3, 2, 2)  # batch=2, C=3, height=2, width=2
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DiscreteUnconditionalEntropyModel Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("feaa6198f8aff996")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, 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 math
import numpy as np
import torch
import torch.nn as nn

# Mock prior distribution class
class MockPrior:
    def __init__(self, num_pmfs=3, pmf_length=5):
        self.num_pmfs = num_pmfs
        self.pmf_length = pmf_length
        # Create normalized PMFs
        raw_pmf = torch.rand(num_pmfs, pmf_length)
        self._pmf = raw_pmf / raw_pmf.sum(dim=1, keepdim=True)
        self._log_pmf = torch.log(self._pmf + 1e-10)
    
    def pmf(self):
        return self._pmf
    
    def log_pmf(self):
        return self._log_pmf
    
    def log_prob(self, indexes):
        # indexes should be integer indices into the PMF
        # For simplicity, we'll gather from the log_pmf
        batch_shape = indexes.shape
        indexes_flat = indexes.flatten()
        # Assume indexes are in range [0, pmf_length)
        # For each index, we need to select from the corresponding PMF
        # We'll use the first PMF for all (simplification)
        log_probs = self._log_pmf[0][indexes_flat.clamp(0, self.pmf_length - 1)]
        return log_probs.reshape(batch_shape)

# Helper function needed by the class
def _pmf_to_quantized_cdf(pmf_list, precision):
    """Convert PMF to quantized CDF."""
    pmf_array = np.array(pmf_list, dtype=np.float64)
    cdf = np.zeros(len(pmf_array) + 1, dtype=np.int32)
    
    # Quantize PMF
    quantized_pmf = np.round(pmf_array * (2 ** precision)).astype(np.int32)
    
    # Ensure sum equals 2^precision
    total = quantized_pmf.sum()
    if total != 2 ** precision:
        quantized_pmf[-1] += (2 ** precision - total)
    
    # Build CDF
    cdf[1:] = np.cumsum(quantized_pmf)
    cdf[-1] = 2 ** precision
    
    return cdf.tolist()

# Create prior
prior = MockPrior(num_pmfs=3, pmf_length=5)

INIT_ARGS = {
    'prior': prior,
    'range_coder_precision': 16
}

# Create indexes tensor for forward pass
# indexes should be integer indices into the PMF
indexes = torch.randint(0, 5, (2, 4))

ARGS = {
    'indexes': indexes
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResBlock Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("dc832fd8ace349ba")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 8, 8) 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 torch.nn as nn

class ResBlock(nn.Module):

    def __init__(self, c, ks=3):
        super().__init__()
        self.m = nn.Sequential(nn.Conv2d(c, c, ks, 1, ks // 2), nn.GELU(), nn.Conv2d(c, c, ks, 1, ks // 2))

    def forward(self, x):
        return x + self.m(x)


INIT_ARGS = {
    'c': 4,
    'ks': 3,
}

ARGS = {
    'x': torch.randn(2, 4, 8, 8),
}

if __name__ == '__main__':
    model = ResBlock(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float, shape (2, 4, 8, 8) — shape (2, 4, 8, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResBlocks Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("4565b9617294b575")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 8, 8) 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 torch.nn as nn

class ResBlock(nn.Module):

    def __init__(self, c, ks=3):
        super().__init__()
        self.m = nn.Sequential(nn.Conv2d(c, c, ks, 1, ks // 2), nn.GELU(), nn.Conv2d(c, c, ks, 1, ks // 2))

    def forward(self, x):
        return x + self.m(x)

class ResBlocks(nn.Module):

    def __init__(self, c, n=3, ks=3):
        super().__init__()
        self.m = nn.Sequential(*[ResBlock(c, ks) for _ in range(n)])

    def forward(self, x):
        return x + self.m(x)


INIT_ARGS = {
    'c': 4,
    'n': 2,
    'ks': 3,
}

ARGS = {
    'x': torch.randn(2, 4, 8, 8),
}

if __name__ == '__main__':
    model = ResBlocks(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print("Success!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float, shape (2, 4, 8, 8) — shape (2, 4, 8, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
VTUnit Ran
ran on a synthesized input
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("34e9bc103d069dad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 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 math
import torch
import torch.nn as nn

# Read the class to understand what it needs:
# VTUnit.__init__ takes: C (channels), spatial_shape (int for block size), ratio (default 0.5)
# VTUnit.forward takes: x (input tensor)
# 
# ChannelFC needs: in_channels, hid_channels, out_channels
# DepthwiseBlockFC needs: C (channels), b (block size)
# 
# In forward:
# - intra_transform is ChannelFC(C, int(C * ratio), C) - takes x with C channels
# - inter_transform is DepthwiseBlockFC(C, spatial_shape) - takes x with C channels
# - x must be 4D for Conv2d: (batch, channels, height, width)
# - spatial_shape is used as b in DepthwiseBlockFC, so it's the block dimension

INIT_ARGS = {
    'C': 4,
    'spatial_shape': 3,
    'ratio': 0.5,
}

# For forward, x needs to be a 4D tensor (batch, channels, height, width)
# where channels = C = 4, and height/width should match spatial_shape = 3
ARGS = {
    'x': torch.randn(2, 4, 3, 3),
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
lower_bound Ran
ran; our contract draft was wrong, not the code
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("cd2b6a6273b8280a")
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 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
torch.manual_seed(0)

# Create small test tensors
x = torch.randn(2, 4, requires_grad=True)
bound = 0.5

ARGS = {
    "x": x,
    "bound": bound,
}
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 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
lower_bound_bwd Ran
ran; our contract draft was wrong, not the code
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("c6cd5ea69bb9b725")
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
from torch import Tensor

torch.manual_seed(0)

# Create small test tensors
x = torch.randn(2, 4)
bound = torch.randn(2, 4)
grad_output = torch.randn(2, 4)

ARGS = {
    "x": x,
    "bound": bound,
    "grad_output": grad_output,
}
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
lower_bound_fwd Ran
ran; our contract draft was wrong, not the code
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("d57226f49d77ce7d")
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 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
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for testing lower_bound_fwd
x = torch.randn(2, 4)
bound = torch.randn(2, 4)

ARGS = {
    "x": x,
    "bound": bound,
}
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 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
upper_bound Ran
ran; our contract draft was wrong, not the code
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("695fd289eae9f9c8")
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 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
torch.manual_seed(0)

# Create small test tensors
x = torch.randn(2, 4, requires_grad=True)
bound = 0.5

ARGS = {
    "x": x,
    "bound": bound,
}
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 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
upper_bound_bwd Ran
ran; our contract draft was wrong, not the code
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("227b9b97a6ddeae4")
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
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for the function parameters
x = torch.randn(2, 4)
bound = torch.randn(2, 4)
grad_output = torch.randn(2, 4)

ARGS = {
    "x": x,
    "bound": bound,
    "grad_output": grad_output,
}
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
upper_bound_fwd Ran
ran; our contract draft was wrong, not the code
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("5a8731ca40e1ec72")
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 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
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for testing
x = torch.randn(2, 4)
bound = torch.randn(2, 4)

ARGS = {
    "x": x,
    "bound": bound,
}
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 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
DiscreteConditionalEntropyModel Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("e689fa262ff9d490")
How it ran

no invocation recorded.

DiscreteEntropyModelBase Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("3ff914a335b7a533")
How it ran

no invocation recorded.

ECVQlastdim Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("ff32920bf4014459")
How it ran

no invocation recorded.

LowerBoundFunction Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("41713d588f89d7dc")
How it ran

no invocation recorded.

NVTC Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("2e77fa5e8c194a5e")
How it ran

no invocation recorded.

Softmax Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("53444b2279a5e878")
How it ran

no invocation recorded.

UpperBoundFunction Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("cf1811e2eb484861")
How it ran

no invocation recorded.

pmf_to_quantized_cdf Not yet run
unverified (harvested, no recorded run)
ustc-imcl/nvtc/image/nvtc_image/model/nvtc.py
code served (permissive licence) · get_code("b5dd898abb1e9dd4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 20 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
pmf_to_quantized_cdf
brick of this paper's assembly: helper
3 other papers
3 later · 1 only as an assembly brick
2406.01597 (2024-06)
End-to-End Rate-Distortion Optimized 3D Gaussian Representation
2507.17336 (2025-07)
Temporal Smoothness-Aware Rate-Distortion Optimized 4D Gaussian Splatting
2507.19125 (2025-07)
Learned Image Compression with Hierarchical Progressive Context Modeling
DiscreteEntropyModelBase
brick of this paper's assembly: helper
1 other paper
1 later
2507.17336 (2025-07)
Temporal Smoothness-Aware Rate-Distortion Optimized 4D Gaussian Splatting
DiscreteUnconditionalEntropyModel
brick of this paper's assembly: helper
1 other paper
1 later
2507.17336 (2025-07)
Temporal Smoothness-Aware Rate-Distortion Optimized 4D Gaussian Splatting

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

In theory, vector quantization (VQ) is always better than scalar quantization (SQ) in terms of rate-distortion (R-D) performance [33]. Recent state-of-the-art methods for neural image compression are mainly based on nonlinear transform coding (NTC) with uniform scalar quantization, overlooking the benefits of VQ due to its exponentially increased complexity. In this paper, we first investigate on some toy sources, demonstrating that even if modern neural networks considerably enhance the compression performance of SQ with nonlinear transform, there is still an insurmountable chasm between SQ and VQ. Therefore, revolving around VQ, we propose a novel framework for neural image compression named Nonlinear Vector Transform Coding (NVTC). NVTC solves the critical complexity issue of VQ through (1) a multi-stage quantization strategy and (2) nonlinear vector transforms. In addition, we apply entropy-constrained VQ in latent space to adaptively determine the quantization boundaries for joint rate-distortion optimization, which improves the performance both theoretically and experimentally. Compared to previous NTC approaches, NVTC demonstrates superior rate-distortion performance, faster decoding speed, and smaller model size. Our code is available at https://github.com/ USTC-IMCL/NVTC.

For agents

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

get_harvested_code_for_paper("2305.16025")
get_code_for_paper("2305.16025")
have("2305.16025")

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

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

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

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

Connect an agent — have() is free.