SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.07648 · CVPR · 2024

CDFormer: When Degradation Prediction Embraces Diffusion Model for Blind Image Super-Resolution

Jie Qin, Chenyi Zhuang, Pan Gao, Qingguo Liu

arXiv · PDF · Open in the Atlas

Code that ran

11 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 9 have no contract verdict; 1 failure of our instrument; 6 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/2405.07648.json · badge: /api/ran/2405.07648.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
I2-Multimedia-Lab/CDFormer community
Papers with Code archive
10 ran · 6 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
Adaptive_Channel_Attention Ran
ran on a synthesized input · constructed an object; no result was computed
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("883de99a17bdfd49")
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, Adaptive_Channel_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)

# Define the module class
class Adaptive_Channel_Attention(nn.Module):
    """ Adaptive Channel Self-Attention
    Args:
        dim (int): Number of input channels.
        num_heads (int): Number of attention heads. Default: 6
        qkv_bias (bool): If True, add a learnable bias to query, key, value. Default: True
        qk_scale (float | None): Override default qk scale of head_dim ** -0.5 if set.
        attn_drop (float): Attention dropout rate. Default: 0.0
        drop_path (float): Stochastic depth rate. Default: 0.0
    """

    def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_drop=0.0, proj_drop=0.0):
        super().__init__()
        self.num_heads = num_heads
        self.temperature = nn.Parameter(torch.ones(num_heads, 1, 1))
        self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
        self.attn_drop = nn.Dropout(attn_drop)
        self.proj = nn.Linear(dim, dim)
        self.proj_drop = nn.Dropout(proj_drop)
        self.dwconv = nn.Sequential(nn.Conv2d(dim, dim, kernel_size=3, stride=1, padding=1, groups=dim), nn.BatchNorm2d(dim), nn.GELU())
        self.channel_interaction = nn.Sequential(nn.AdaptiveAvgPool2d(1), nn.Conv2d(dim, dim // 8, kernel_size=1), nn.BatchNorm2d(dim // 8), nn.GELU(), nn.Conv2d(dim // 8, dim, kernel_size=1))
        self.spatial_interaction = nn.Sequential(nn.Conv2d(dim, dim // 16, kernel_size=1), nn.BatchNorm2d(dim // 16), nn.GELU(), nn.Conv2d(dim // 16, 1, kernel_size=1))

    def forward(self, x, H, W):
        """
        Input: x: (B, H*W, C), H, W
        Output: x: (B, H*W, C)
        """
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads)
        qkv = qkv.permute(2, 0, 3, 1, 4)
        q, k, v = (qkv[0], qkv[1], qkv[2])
        q = q.transpose(-2, -1)
        k = k.transpose(-2, -1)
        v = v.transpose(-2, -1)
        q = torch.nn.functional.normalize(q, dim=-1)
        k = torch.nn.functional.normalize(k, dim=-1)
        v_ = v.reshape(B, C, N).contiguous().view(B, C, H, W)
        attn = q @ k.transpose(-2, -1) * self.temperature
        attn = attn.softmax(dim=-1)
        attn = self.attn_drop(attn)
        attened_x = (attn @ v).permute(0, 3, 1, 2).reshape(B, N, C)
        conv_x = self.dwconv(v_)
        attention_reshape = attened_x.transpose(-2, -1).contiguous().view(B, C, H, W)
        channel_map = self.channel_interaction(attention_reshape)
        spatial_map = self.spatial_interaction(conv_x).permute(0, 2, 3, 1).contiguous().view(B, N, 1)
        attened_x = attened_x * torch.sigmoid(spatial_map)
        conv_x = conv_x * torch.sigmoid(channel_map)
        conv_x = conv_x.permute(0, 2, 3, 1).contiguous().view(B, N, C)
        x = attened_x + conv_x
        x = self.proj(x)
        x = self.proj_drop(x)
        return x

# Create setup arguments
B = 2
H = 3
W = 3
N = H * W
C = 8
num_heads = 2

# Create input tensor: (B, H*W, C)
x = torch.randn(B, N, C)

ARGS = {
    'dim': C,
    'num_heads': num_heads,
    '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 Adaptive_Channel_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 Adaptive_Channel_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
CDIM Ran
ran on a synthesized input · constructed an object; no result was computed
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("6a864a551fa60c54")
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, CDIM: 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)

class CDIM(nn.Module):

    def __init__(self, dim):
        super().__init__()
        self.kernel = nn.Sequential(nn.Linear(256, dim * 2, bias=False))

    def forward(self, x, cdp):
        """
        Input: x: (B, H*W, C), x_size: (H, W)
        Output: x: (B, H*W, C)
        """
        B, N, C = x.shape
        cdp = self.kernel(cdp).view(-1, 1, C * 2)
        cdp1, cdp2 = cdp.chunk(2, dim=2)
        x = x * cdp1 + cdp2
        return x


# Setup arguments
dim = 4
cdim_model = CDIM(dim=dim)

# x: (B, H*W, C) where B=2, H*W=6, C=4
x = torch.randn(2, 6, 4)

# cdp: input to kernel which expects (B, 256)
cdp = torch.randn(2, 256)

ARGS = {
    "dim": dim,
}
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 CDIM — 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 CDIM 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
Encoder_gt Ran
ran on a synthesized input
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("4bbad1997ef09a44")
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 2, 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 numpy as np
from scipy import ndimage

# Setup code for the provided class
INIT_ARGS = {
    'feats': 4,
    'scale': 4
}

# Create input tensors for forward pass
batch_size = 2
h, w = 8, 8  # Small spatial dimensions
in_channels = 3
gt_channels = 3

# Input tensor x: (batch_size, in_channels, h, w)
x = torch.randn(batch_size, in_channels, h, w)

# Ground truth tensor gt: (batch_size, gt_channels, h*scale, w*scale)
gt = torch.randn(batch_size, gt_channels, h * INIT_ARGS['scale'], w * INIT_ARGS['scale'])

ARGS = {
    'x': x,
    'gt': gt
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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 — 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)
Encoder_lr Ran
ran on a synthesized input · constructed an object; no result was computed
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("025d0ee70cc05b46")
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, Encoder_lr: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import types as _types

torch.manual_seed(0)

# Define the helper functions and classes needed
class ResBlock(nn.Module):
    def __init__(self, conv, n_feats, kernel_size, bias=True, bn=False, act=nn.LeakyReLU(0.1, inplace=True), res_scale=1):
        super(ResBlock, self).__init__()
        m = []
        for i in range(2):
            m.append(conv(n_feats, n_feats, kernel_size, bias=bias))
            if bn:
                m.append(nn.BatchNorm2d(n_feats))
            if i == 0:
                m.append(act)
        self.body = nn.Sequential(*m)

    def forward(self, x):
        res = self.body(x)
        res += x
        return res

def default_conv(in_channels, out_channels, kernel_size, bias=True):
    return nn.Conv2d(in_channels, out_channels, kernel_size, padding=kernel_size // 2, bias=bias)

class Encoder_lr(nn.Module):
    def __init__(self, feats=64, scale=4):
        super(Encoder_lr, self).__init__()
        self.scale = scale
        self.E = nn.Sequential(
            nn.Conv2d(3, feats, kernel_size=3, padding=1),
            nn.LeakyReLU(0.1, True),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            ResBlock(default_conv, feats, kernel_size=3),
            nn.Conv2d(feats, feats * 2, kernel_size=3, padding=1),
            nn.LeakyReLU(0.1, True),
            nn.Conv2d(feats * 2, feats * 2, kernel_size=3, padding=1),
            nn.LeakyReLU(0.1, True),
            nn.Conv2d(feats * 2, feats * 4, kernel_size=3, padding=1),
            nn.LeakyReLU(0.1, True),
            nn.AdaptiveAvgPool2d(1)
        )
        self.mlp = nn.Sequential(
            nn.Linear(feats * 4, feats * 4),
            nn.LeakyReLU(0.1, True),
            nn.Linear(feats * 4, feats * 4),
            nn.LeakyReLU(0.1, True)
        )

    def forward(self, x):
        fea = self.E(x).squeeze(-1).squeeze(-1)
        fea1 = self.mlp(fea)
        return fea1

# Create common namespace with necessary items
common = _types.SimpleNamespace(
    ResBlock=ResBlock,
    default_conv=default_conv,
    MeanShift=None,
    Upsampler=None
)

# Define ARGS
ARGS = {
    'feats': 64,
    'scale': 4
}
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 Encoder_lr — 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 Encoder_lr 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
ResBlock Ran
ran on a synthesized input · constructed an object; no result was computed
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("a3042307eff34889")
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, ResBlock: 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 a minimal conv function that satisfies how it's used in ResBlock
# The ResBlock calls: conv(n_feats, n_feats, kernel_size, bias=bias)
def conv_func(in_channels, out_channels, kernel_size, bias=True):
    return nn.Conv2d(in_channels, out_channels, kernel_size, padding=kernel_size // 2, bias=bias)

# Define the arguments dictionary
ARGS = {
    'conv': conv_func,
    'n_feats': 4,
    'kernel_size': 3,
    'bias': True,
    'bn': False,
    'act': nn.LeakyReLU(0.1, inplace=True),
    'res_scale': 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 ResBlock — 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 ResBlock 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
SGFN Ran
ran on a synthesized input · constructed an object; no result was computed
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("6f4fdd263c5a3bbc")
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, SGFN: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define ARGS dict with all parameters for SGFN
ARGS = {
    "in_features": 8,
    "hidden_features": 16,
    "out_features": 8,
    "act_layer": nn.GELU,
    "drop": 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SGFN — 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 SGFN 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
SpatialGate Ran
ran on a synthesized input
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("344fa5e773a89498")
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 3, 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: dim is half of input channels, so if we want total channels = 8, dim = 4
INIT_ARGS = {
    'dim': 4
}

# ARGS: forward takes x, H, W
# x has shape (B, N, C) where C must be 2*dim = 8 (since it gets chunked into 2 parts)
# N = H * W (flattened spatial dimensions)
# Let's use H=3, W=5, so N=15
B = 2
H = 3
W = 5
N = H * W
C = 2 * INIT_ARGS['dim']  # 8

x = torch.randn(B, N, C)

ARGS = {
    'x': x,
    'H': H,
    'W': W
}
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 3, 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)
Spatial_Attention Ran
ran on a synthesized input · constructed an object; no result was computed
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("23c44909d59e9fe0")
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, Spatial_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)

ARGS = {
    "dim": 16,
    "idx": 0,
    "split_size": [8, 8],
    "dim_out": 16,
    "num_heads": 4,
    "attn_drop": 0.0,
    "proj_drop": 0.0,
    "qk_scale": None,
    "position_bias": True,
}
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 Spatial_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 Spatial_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
default Ran
ran, violated the contract we drafted
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("29f7ce0623edc8cb")
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 str. 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.

from inspect import isfunction

def exists(x):
    return x is not None

def default(val, d):
    if exists(val):
        return val
    return d() if isfunction(d) else d

# Test case 1: val is not None, should return val
val_1 = "test_value"
d_1 = "default_value"

# Test case 2: val is None, d is a callable
val_2 = None
d_2 = lambda: "computed_default"

# Test case 3: val is None, d is a non-callable value
val_3 = None
d_3 = 42

ARGS = {
    "val": val_1,
    "d": d_1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
default_conv Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from coloquinte/torchsr
pointer only · get_code("8b0e794d4d8f9b13")
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.

denoise Ran
ran on a synthesized input · constructed an object; no result was computed
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("5a5975f4e5f4f7a7")
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, denoise: 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 the denoise module
model = nn.Module()

# Create input tensors
# x should have shape (batch_size, feats * 4 * 2)
# According to forward: torch.cat([x, t, c], dim=1)
# x gets concatenated with t (shape batch, 1) and c
# The mlp input is feats * 4 * 2 + 1, so: x_dim + t_dim + c_dim = feats * 4 * 2 + 1
# With feats=64: 64 * 4 * 2 + 1 = 513
# Let's say x has dim 256, t has dim 1, c has dim 256
# 256 + 1 + 256 = 513 ✓

batch_size = 2
feats = 64

x = torch.randn(batch_size, feats * 4 * 2)  # shape (2, 512)
t = torch.randint(0, 50, (batch_size,))      # shape (2,)
c = torch.randn(batch_size, feats * 4)       # shape (2, 256)

ARGS = {
    'feats': feats,
    'timesteps': 5
}
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 denoise — 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 denoise 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
Adaptive_Spatial_Attention Not yet run
unverified (harvested, no recorded run)
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("f957c6c7ab191a7f")
How it ran

no invocation recorded.

CDFormer Not yet run
unverified (harvested, no recorded run)
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("6401585050c061d5")
How it ran

no invocation recorded.

CDFormer_SR Not yet run
unverified (harvested, no recorded run)
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("0109253a712dead3")
How it ran

no invocation recorded.

CDRB Not yet run
unverified (harvested, no recorded run)
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("663bc75d518cc360")
How it ran

no invocation recorded.

DDPM Not yet run
unverified (harvested, no recorded run)
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("7bf826ead30f1aaa")
How it ran

no invocation recorded.

ResidualGroup Not yet run
unverified (harvested, no recorded run)
I2-Multimedia-Lab/CDFormer/model/cdformer.py
code served (permissive licence) · get_code("986cf10a4f977a9e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 2 the same month, 2 later) and 12 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
default
brick of this paper's assembly: helper
207 other papers
145 dated earlier, 4 the same month, 52 later, 6 same year, order not determinable · 41 only as an assembly brick
1711.11585 (2017-11)
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2010.08162 (2020-10)
SidechainNet: An All-Atom Protein Structure Dataset for Machine Learning
and 204 more not named here
default_conv
brick of this paper's assembly: helper
57 other papers
43 dated earlier, 1 the same month, 10 later, 3 same year, order not determinable · 2 only as an assembly brick
1707.02921 (2017-07)
Enhanced Deep Residual Networks for Single Image Super-Resolution
1803.02735 (2018-03)
Deep Back-Projection Networks For Super-Resolution
1803.04626 (2018-03)
Maintaining Natural Image Statistics with the Contextual Loss
and 54 more not named here
SGFN
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 2 only as an assembly brick
2308.03364 (2023-08)
Dual Aggregation Transformer for Image Super-Resolution
2403.01598 (2024-03)
APISR: Anime Production Inspired Real-World Anime Super-Resolution
SpatialGate
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 2 only as an assembly brick
2308.03364 (2023-08)
Dual Aggregation Transformer for Image Super-Resolution
2403.01598 (2024-03)
APISR: Anime Production Inspired Real-World Anime Super-Resolution
Spatial_Attention
brick of this paper's assembly: model
2 other papers
2 dated earlier · 2 only as an assembly brick
2308.03364 (2023-08)
Dual Aggregation Transformer for Image Super-Resolution
2403.01598 (2024-03)
APISR: Anime Production Inspired Real-World Anime Super-Resolution

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

Existing Blind image Super-Resolution (BSR) methods focus on estimating either kernel or degradation information, but have long overlooked the essential content details. In this paper, we propose a novel BSR approach, Content-aware Degradation-driven Transformer (CDFormer), to capture both degradation and content representations. However, low-resolution images cannot provide enough content details, and thus we introduce a diffusion-based module CDF ormer dif f to first learn Content Degradation Prior (CDP) in both low-and highresolution images, and then approximate the real distribution given only low-resolution information. Moreover, we apply an adaptive SR network CDF ormer SR that effectively utilizes CDP to refine features. Compared to previous diffusion-based SR methods, we treat the diffusion model as an estimator that can overcome the limitations of expensive sampling time and excessive diversity. Experiments show that CDFormer can outperform existing methods, establishing a new state-of-the-art performance on various benchmarks under blind settings. Codes and models will be available at https://github.com/I2-Multimedia-Lab/CDFormer.

For agents

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

get_harvested_code_for_paper("2405.07648")
get_code_for_paper("2405.07648")
have("2405.07648")

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

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

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

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

Connect an agent — have() is free.