| GraphConvolution |
Ran ran on a synthesized input · constructed an object; no result was computed |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("4af7cba6f2b6a00b") How it ranRan 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, GraphConvolution: 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)
# Analyze the forward method:
# - adj: used in torch.matmul(nodes, adj), so needs shape compatible with nodes
# - nodes: input tensor, goes through matmul with adj, then relu, then Conv1d
#
# Conv1d expects input of shape (batch, in_dim, length) or (batch, in_dim)
# So nodes should have shape (batch, in_dim, seq_len) where seq_len could be 1
# adj should be (seq_len, seq_len) or similar to work with matmul
#
# Let's use:
# - batch_size = 2
# - in_dim = 4
# - seq_len = 3
# - out_dim = 5
in_dim = 4
out_dim = 5
batch_size = 2
seq_len = 3
# Create adj matrix: (seq_len, seq_len)
adj = torch.randn(seq_len, seq_len)
# Create nodes tensor: (batch, in_dim, seq_len)
nodes = torch.randn(batch_size, in_dim, seq_len)
ARGS = {
"in_dim": in_dim,
"out_dim": out_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 GraphConvolution — 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 GraphConvolution 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
|
| PositionEmbeddingLearned |
Ran ran on a synthesized input · constructed an object; no result was computed |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("0fdd4b27f23fb10e") How it ranRan 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, PositionEmbeddingLearned: 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 PositionEmbeddingLearned(nn.Module):
"""
Absolute pos embedding, learned.
"""
def __init__(self, num_pos_feats=256):
super(PositionEmbeddingLearned, self).__init__()
self.row_embed = nn.Embedding(50, num_pos_feats)
self.col_embed = nn.Embedding(50, num_pos_feats)
self.reset_parameters()
def reset_parameters(self):
nn.init.uniform_(self.row_embed.weight)
nn.init.uniform_(self.col_embed.weight)
def forward(self, x):
h, w = x.shape[-2:]
i = torch.arange(w, device=x.device)
j = torch.arange(h, device=x.device)
x_emb = self.col_embed(i)
y_emb = self.row_embed(j)
pos = torch.cat([x_emb.unsqueeze(0).repeat(h, 1, 1), y_emb.unsqueeze(1).repeat(1, w, 1)], dim=-1).permute(2, 0, 1).unsqueeze(0).repeat(x.shape[0], 1, 1, 1)
return pos
# Create test input tensor: batch_size=2, channels=4, height=3, width=5
test_input = torch.randn(2, 4, 3, 5)
# Test the module instantiation and forward pass
model = PositionEmbeddingLearned(num_pos_feats=256)
output = model(test_input)
ARGS = {
"num_pos_feats": 256
}
- 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 PositionEmbeddingLearned — 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 PositionEmbeddingLearned 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
|
| PositionEmbeddingSine |
Ran ran on a synthesized input |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("19ad134c39cefe3a") How it ranRan 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
class PositionEmbeddingSine(nn.Module):
"""
This is a more standard version of the position embedding, very similar to the one
used by the Attention is all you need paper, generalized to work on images.
"""
def __init__(self, num_pos_feats=64, temperature=10000, normalize=False, scale=None):
super(PositionEmbeddingSine, self).__init__()
self.num_pos_feats = num_pos_feats
self.temperature = temperature
self.normalize = normalize
if scale is not None and normalize is False:
raise ValueError('normalize should be True if scale is passed')
if scale is None:
scale = 2 * math.pi
self.scale = scale
def forward(self, x, mask):
assert mask is not None
not_mask = ~mask
y_embed = not_mask.cumsum(1, dtype=torch.float32)
x_embed = not_mask.cumsum(2, dtype=torch.float32)
if self.normalize:
eps = 1e-06
y_embed = y_embed / (y_embed[:, -1:, :] + eps) * self.scale
x_embed = x_embed / (x_embed[:, :, -1:] + eps) * self.scale
dim_t = torch.arange(self.num_pos_feats, dtype=torch.float32, device=x.device)
dim_t = self.temperature ** (2 * (dim_t // 2) / self.num_pos_feats)
pos_x = x_embed[:, :, :, None] / dim_t
pos_y = y_embed[:, :, :, None] / dim_t
pos_x = torch.stack((pos_x[:, :, :, 0::2].sin(), pos_x[:, :, :, 1::2].cos()), dim=4).flatten(3)
pos_y = torch.stack((pos_y[:, :, :, 0::2].sin(), pos_y[:, :, :, 1::2].cos()), dim=4).flatten(3)
pos = torch.cat((pos_y, pos_x), dim=3).permute(0, 3, 1, 2)
return pos
INIT_ARGS = {
'num_pos_feats': 32,
'temperature': 10000,
'normalize': True,
'scale': 2 * math.pi
}
batch_size = 2
height = 5
width = 7
channels = 16
x = torch.randn(batch_size, channels, height, width)
mask = torch.zeros(batch_size, height, width, dtype=torch.bool)
mask[0, 2:4, 3:5] = True
mask[1, 0:2, 1:3] = True
ARGS = {
'x': x,
'mask': mask
}
- 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)
|
| TopKMaxPooling |
Ran ran on a synthesized input |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("b98e254770325b03") How it ranRan 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
# INIT_ARGS: parameters for TopKMaxPooling.__init__
INIT_ARGS = {
'kmax': 0.5 # Take top 50% of spatial locations
}
# ARGS: parameters for TopKMaxPooling.forward
# Input should be a 4D tensor: (batch_size, num_channels, height, width)
ARGS = {
'input': torch.randn(2, 3, 4, 5) # batch=2, channels=3, height=4, width=5
}
- 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 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)
|
| TransformerDecoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("e3629529c763edf7") How it ranRan 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, TransformerDecoder: 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 copy
torch.manual_seed(0)
# Build a minimal decoder layer that matches the interface expected
class SimpleDecoderLayer(nn.Module):
def __init__(self, d_model=4):
super().__init__()
self.linear = nn.Linear(d_model, d_model)
def forward(self, tgt, memory, tgt_mask=None, memory_mask=None,
tgt_key_padding_mask=None, memory_key_padding_mask=None,
pos=None, query_pos=None):
# Simple forward: just process tgt through linear layer
return self.linear(tgt)
# Build a minimal norm layer
norm_layer = nn.LayerNorm(4)
# Create decoder layer instance
decoder_layer = SimpleDecoderLayer(d_model=4)
# Create number of layers
num_layers = 2
ARGS = {
"decoder_layer": decoder_layer,
"num_layers": num_layers,
"norm": norm_layer,
"return_intermediate": False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type TransformerDecoder — 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 TransformerDecoder 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
|
| TransformerDecoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("a1044a3d81853ba9") How it ranRan 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, TransformerDecoderLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.manual_seed(0)
# Create small tensors for the decoder layer
batch_size = 2
seq_len_tgt = 3
seq_len_memory = 5
d_model = 4
nhead = 2
dim_feedforward = 8
# Target tensor (query)
tgt = torch.randn(seq_len_tgt, batch_size, d_model)
# Memory tensor (key/value from encoder)
memory = torch.randn(seq_len_memory, batch_size, d_model)
# Positional embeddings (optional)
pos = torch.randn(seq_len_memory, batch_size, d_model)
query_pos = torch.randn(seq_len_tgt, batch_size, d_model)
# Attention masks (optional)
tgt_mask = None
memory_mask = None
# Key padding masks (optional)
tgt_key_padding_mask = None
memory_key_padding_mask = None
ARGS = {
'd_model': d_model,
'nhead': nhead,
'dim_feedforward': dim_feedforward,
'dropout': 0.1,
'activation': 'relu',
'normalize_before': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type TransformerDecoderLayer — 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 TransformerDecoderLayer 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
|
| TransformerEncoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("8ee0966a4a5305fa") How it ranRan 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, TransformerEncoder: 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 copy
torch.manual_seed(0)
# Create a minimal encoder layer that matches the expected interface
class MinimalEncoderLayer(nn.Module):
def __init__(self, d_model=4):
super().__init__()
self.d_model = d_model
self.linear = nn.Linear(d_model, d_model)
def forward(self, src, src_mask=None, src_key_padding_mask=None, pos=None):
# The function calls this with src and optional mask/pos arguments
return self.linear(src)
# Create a minimal norm layer
norm_layer = nn.LayerNorm(4)
# Create encoder layer instance
encoder_layer = MinimalEncoderLayer(d_model=4)
# Number of layers to clone
num_layers = 2
ARGS = {
'encoder_layer': encoder_layer,
'num_layers': num_layers,
'norm': norm_layer
}
- 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 TransformerEncoder — 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 TransformerEncoder 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
|
| TransformerEncoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("4a32b2ac8f43376e") How it ranRan 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, TransformerEncoderLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.manual_seed(0)
def _get_activation_fn(activation):
"""Return an activation function given a string"""
if activation == 'relu':
return F.relu
if activation == 'gelu':
return F.gelu
if activation == 'glu':
return F.glu
raise RuntimeError('activation should be relu/gelu, not {activation}.')
class TransformerEncoderLayer(nn.Module):
def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation='relu', normalize_before=False):
super(TransformerEncoderLayer, self).__init__()
self.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
self.linear1 = nn.Linear(d_model, dim_feedforward)
self.dropout = nn.Dropout(dropout)
self.linear2 = nn.Linear(dim_feedforward, d_model)
self.norm1 = nn.LayerNorm(d_model)
self.norm2 = nn.LayerNorm(d_model)
self.dropout1 = nn.Dropout(dropout)
self.dropout2 = nn.Dropout(dropout)
self.activation = _get_activation_fn(activation)
self.normalize_before = normalize_before
def with_pos_embed(self, tensor, pos=None):
return tensor if pos is None else tensor + pos
def without_pos_embed(self, tensor, pos=None):
return tensor
def forward_post(self, src, src_mask=None, src_key_padding_mask=None, pos=None):
q = k = self.with_pos_embed(src, pos)
src2 = self.self_attn(q, k, value=src, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
src = src + self.dropout1(src2)
src = self.norm1(src)
src2 = self.linear2(self.dropout(self.activation(self.linear1(src))))
src = src + self.dropout2(src2)
src = self.norm2(src)
return src
def forward_pre(self, src, src_mask=None, src_key_padding_mask=None, pos=None):
src2 = self.norm1(src)
q = k = self.with_pos_embed(src2, pos)
src2 = self.self_attn(q, k, value=src2, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
src = src + self.dropout1(src2)
src2 = self.norm2(src)
src2 = self.linear2(self.dropout(self.activation(self.linear1(src2))))
src = src + self.dropout2(src2)
return src
def forward(self, src, src_mask=None, src_key_padding_mask=None, pos=None):
if self.normalize_before:
return self.forward_pre(src, src_mask, src_key_padding_mask, pos)
return self.forward_post(src, src_mask, src_key_padding_mask, pos)
# Create tiny tensors for testing
# src shape: (seq_len, batch_size, d_model)
src = torch.randn(3, 2, 4)
pos = torch.randn(3, 2, 4)
ARGS = {
'd_model': 4,
'nhead': 2,
'dim_feedforward': 8,
'dropout': 0.1,
'activation': 'relu',
'normalize_before': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type TransformerEncoderLayer — 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 TransformerEncoderLayer 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
|
| build_position_encoding |
Ran ran; our contract draft was wrong, not the code |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("626421743e751cfd") How it ranRan 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 PositionEmbeddingSine. 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)
ARGS = {
'hidden_dim': 128,
'mode': 'sine'
}
- 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 PositionEmbeddingSine — a PositionEmbeddingSine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PositionEmbeddingSine 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
|
| TDRG |
Not yet run unverified (harvested, no recorded run) |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("e32b7a1a6935ef81") How it ran |
| Transformer |
Not yet run unverified (harvested, no recorded run) |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("a6af96a295df827c") How it ran |
| build_transformer |
Not yet run unverified (harvested, no recorded run) |
iCVTEAM/TDRG/models/TDRG.py code served (permissive licence) · get_code("2a6ad2bf42c596fb") How it ran |