| AddReadout |
Ran ran on a synthesized input · constructed an object; no result was computed |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("4782ef3501c0aabc") 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, AddReadout: 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)
# The AddReadout module expects:
# - __init__ parameter: start_index (int, default=1)
# - forward expects: x (tensor of shape [batch, seq_len, ...])
# The forward method accesses x[:, 0], x[:, 1], and x[:, start_index:]
# So we need at least 2 columns if start_index could be 2, or start_index+1 columns minimum
# Create a small input tensor
# Shape: [batch_size=2, sequence_length=4, feature_dim=3]
x = torch.randn(2, 4, 3)
# Test with start_index=1 (default case)
ARGS = {
"start_index": 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 AddReadout — 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 AddReadout 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
|
| AddReadout |
Ran ran on a synthesized input · constructed an object; no result was computed |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("fdf08c76f454e01c") 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, AddReadout: 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 sample input tensor
# Shape: (batch_size=2, num_tokens=5, feature_dim=4)
# Token 0 is the readout/cls token, tokens 1-4 are the rest
x = torch.randn(2, 5, 4)
ARGS = {
"start_index": 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 AddReadout — 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 AddReadout 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
|
| ConvTransposeNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("8240f7db0115e798") 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, ConvTransposeNorm: 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)
# ConvTransposeNorm.__init__ takes:
# in_chs, out_chs, kernel_size=1, stride=1, pad=0, dilation=1, groups=1, bn_weight_init=1
ARGS = {
'in_chs': 3,
'out_chs': 16,
'kernel_size': 3,
'stride': 2,
'pad': 1,
'dilation': 1,
'groups': 1,
'bn_weight_init': 1.0,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ConvTransposeNorm — 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 ConvTransposeNorm output the recorded ndim 1 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
|
| DenseModule |
Ran ran on a synthesized input |
kritiksoman/GIMP-ML/gimp-plugins/face-parsing-PyTorch/modules/dense.py code served (permissive licence) · get_code("77f1e43db395c047") 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.
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as functional
# Define activation constants
ACT_RELU = 'relu'
ACT_LEAKY_RELU = 'leaky_relu'
ACT_ELU = 'elu'
class ABN(nn.Module):
"""Activated Batch Normalization
This gathers a `BatchNorm2d` and an activation function in a single module
"""
def __init__(self, num_features, eps=1e-05, momentum=0.1, affine=True, activation='leaky_relu', slope=0.01):
"""Creates an Activated Batch Normalization module
Parameters
----------
num_features : int
Number of feature channels in the input and output.
eps : float
Small constant to prevent numerical issues.
momentum : float
Momentum factor applied to compute running statistics as.
affine : bool
If `True` apply learned scale and shift transformation after normalization.
activation : str
Name of the activation functions, one of: `leaky_relu`, `elu` or `none`.
slope : float
Negative slope for the `leaky_relu` activation.
"""
super(ABN, self).__init__()
self.num_features = num_features
self.affine = affine
self.eps = eps
self.momentum = momentum
self.activation = activation
self.slope = slope
if self.affine:
self.weight = nn.Parameter(torch.ones(num_features))
self.bias = nn.Parameter(torch.zeros(num_features))
else:
self.register_parameter('weight', None)
self.register_parameter('bias', None)
self.register_buffer('running_mean', torch.zeros(num_features))
self.register_buffer('running_var', torch.ones(num_features))
self.reset_parameters()
def reset_parameters(self):
nn.init.constant_(self.running_mean, 0)
nn.init.constant_(self.running_var, 1)
if self.affine:
nn.init.constant_(self.weight, 1)
nn.init.constant_(self.bias, 0)
def forward(self, x):
x = functional.batch_norm(x, self.running_mean, self.running_var, self.weight, self.bias, self.training, self.momentum, self.eps)
if self.activation == ACT_RELU:
return functional.relu(x, inplace=True)
elif self.activation == ACT_LEAKY_RELU:
return functional.leaky_relu(x, negative_slope=self.slope, inplace=True)
elif self.activation == ACT_ELU:
return functional.elu(x, inplace=True)
else:
return x
def __repr__(self):
rep = '{name}({num_features}, eps={eps}, momentum={momentum}, affine={affine}, activation={activation}'
if self.activation == 'leaky_relu':
rep += ', slope={slope})'
else:
rep += ')'
return rep.format(name=self.__class__.__name__, **self.__dict__)
class DenseModule(nn.Module):
def __init__(self, in_channels, growth, layers, bottleneck_factor=4, norm_act=ABN, dilation=1):
super(DenseModule, self).__init__()
self.in_channels = in_channels
self.growth = growth
self.layers = layers
self.convs1 = nn.ModuleList()
self.convs3 = nn.ModuleList()
for i in range(self.layers):
self.convs1.append(nn.Sequential(OrderedDict([('bn', norm_act(in_channels)), ('conv', nn.Conv2d(in_channels, self.growth * bottleneck_factor, 1, bias=False))])))
self.convs3.append(nn.Sequential(OrderedDict([('bn', norm_act(self.growth * bottleneck_factor)), ('conv', nn.Conv2d(self.growth * bottleneck_factor, self.growth, 3, padding=dilation, bias=False, dilation=dilation))])))
in_channels += self.growth
@property
def out_channels(self):
return self.in_channels + self.growth * self.layers
def forward(self, x):
inputs = [x]
for i in range(self.layers):
x = torch.cat(inputs, dim=1)
x = self.convs1[i](x)
x = self.convs3[i](x)
inputs += [x]
return torch.cat(inputs, dim=1)
INIT_ARGS = {
'in_channels': 4,
'growth': 3,
'layers': 2,
'bottleneck_factor': 4,
'norm_act': ABN,
'dilation': 1,
}
ARGS = {
'x': torch.randn(2, 4, 5, 6),
}
if __name__ == '__main__':
module = DenseModule(**INIT_ARGS)
module.eval()
output = module(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected out_channels: {module.out_channels}")
print(f"Actual output channels: {output.shape[1]}")
- 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)
|
| FeatureFusionBlock_custom |
Ran ran on a synthesized input · constructed an object; no result was computed |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("705f05e8d52b9d65") 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, FeatureFusionBlock_custom: 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 simple activation function
activation = nn.ReLU()
# Define ARGS dictionary with all parameters for FeatureFusionBlock_custom
ARGS = {
"features": 64,
"activation": activation,
"deconv": False,
"bn": False,
"expand": False,
"align_corners": 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 FeatureFusionBlock_custom — 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 FeatureFusionBlock_custom 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
|
| FeatureFusionBlock_custom |
Ran ran on a synthesized input · constructed an object; no result was computed |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("69e4902e56f0053b") 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, FeatureFusionBlock_custom: 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 a simple activation function
activation = nn.ReLU()
# Create ARGS dict with all parameters for FeatureFusionBlock_custom
ARGS = {
'features': 64,
'activation': activation,
'deconv': False,
'bn': False,
'expand': False,
'align_corners': True,
'size': None,
}
- 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 FeatureFusionBlock_custom — 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 FeatureFusionBlock_custom 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
|
| FeatureFusionBlock_custom |
Ran ran on a synthesized input · constructed an object; no result was computed |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("4576c78c9d855e07") 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, FeatureFusionBlock_custom: 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 activation function
activation = nn.GELU()
# Define ARGS dictionary with all parameters for FeatureFusionBlock_custom
ARGS = {
"features": 4,
"activation": activation,
"deconv": False,
"bn": False,
"expand": False,
"align_corners": 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 FeatureFusionBlock_custom — 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 FeatureFusionBlock_custom 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
|
| Interpolate |
Ran ran on a synthesized input · constructed an object; no result was computed |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("4d3bc9d67979fdce") 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, Interpolate: 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 small input tensor for testing
# Shape: (batch_size=2, channels=4, height=8, width=8)
x = torch.randn(2, 4, 8, 8)
# Define arguments for the Interpolate module
ARGS = {
"scale_factor": 2.0,
"mode": "bilinear",
"align_corners": 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 Interpolate — 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 Interpolate 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
|
| ProjectReadout |
Ran ran on a synthesized input · constructed an object; no result was computed |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("82c0dc1235af8394") 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, ProjectReadout: 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 = {
"in_features": 4,
"start_index": 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 ProjectReadout — 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 ProjectReadout 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
|
| ProjectReadout |
Ran ran on a synthesized input · constructed an object; no result was computed |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("be974dd5cad0abae") 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, ProjectReadout: 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 = {
"in_features": 4,
"start_index": 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 ProjectReadout — 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 ProjectReadout 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
|
| Read_add |
Ran ran on a synthesized input · constructed an object; no result was computed |
antocad/FocusOnDepth/FOD/Reassemble.py code served (permissive licence) · get_code("05825257cdc82de7") 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, Read_add: 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 Read_add(nn.Module):
def __init__(self, start_index=1):
super(Read_add, self).__init__()
self.start_index = start_index
def forward(self, x):
if self.start_index == 2:
readout = (x[:, 0] + x[:, 1]) / 2
else:
readout = x[:, 0]
return x[:, self.start_index:] + readout.unsqueeze(1)
# Create a model instance with start_index=1
model_instance = Read_add(start_index=1)
# Create input tensor: batch_size=2, sequence_length=4
x = torch.randn(2, 4)
ARGS = {
"start_index": 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 Read_add — 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 Read_add 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
|
| Read_ignore |
Ran ran on a synthesized input · constructed an object; no result was computed |
antocad/FocusOnDepth/FOD/Reassemble.py code served (permissive licence) · get_code("d76671baa974e77d") 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, Read_ignore: 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)
# Read_ignore.__init__ takes start_index parameter
# Read_ignore.forward takes x (a tensor) and slices from start_index onwards
# We need to construct a small tensor to pass through
# Create a small input tensor: batch_size=2, sequence_length=4
x = torch.randn(2, 4)
ARGS = {
"start_index": 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 Read_ignore — 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 Read_ignore 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
|
| Read_projection |
Ran ran on a synthesized input · constructed an object; no result was computed |
antocad/FocusOnDepth/FOD/Reassemble.py code served (permissive licence) · get_code("e5131d4e780dfe22") 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, Read_projection: 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)
# Read_projection.__init__ takes: self, in_features, start_index=1
# Read_projection.forward takes: self, x
# where x is a tensor with shape (batch, seq_len, in_features)
in_features = 4
start_index = 1
batch_size = 2
seq_len = 5
# Create a small input tensor
# x shape: (batch_size, seq_len, in_features)
x = torch.randn(batch_size, seq_len, in_features)
ARGS = {
"in_features": in_features,
"start_index": start_index,
}
- 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 Read_projection — 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 Read_projection 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
|
| Reassemble |
Ran ran on a synthesized input · constructed an object; no result was computed |
antocad/FocusOnDepth/FOD/Reassemble.py code served (permissive licence) · get_code("9833e8e2ddd1a025") 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, Reassemble: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
from einops.layers.torch import Rearrange
torch.manual_seed(0)
# Parameters for Reassemble
image_size = (3, 16, 16) # (channels, height, width)
read = 'projection' # One of: 'ignore', 'add', 'projection'
p = 4 # patch size
s = 16 # resample coefficient
emb_dim = 8 # embedding dimension
resample_dim = 12 # resample dimension
ARGS = {
'image_size': image_size,
'read': read,
'p': p,
's': s,
'emb_dim': emb_dim,
'resample_dim': resample_dim
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Reassemble — 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 Reassemble 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
|
| Resample |
Ran ran on a synthesized input · constructed an object; no result was computed |
antocad/FocusOnDepth/FOD/Reassemble.py code served (permissive licence) · get_code("df66bec2bdd54087") 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, Resample: 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 = {
'p': 0.5,
's': 8,
'h': 64,
'emb_dim': 4,
'resample_dim': 8,
}
- 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 Resample — 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 Resample 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
|
| ResidualConvUnit_custom |
Ran ran on a synthesized input · constructed an object; no result was computed |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("14deec34c07b1b22") 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, ResidualConvUnit_custom: 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 activation function
activation = nn.ReLU()
# Create arguments dict
ARGS = {
'features': 4,
'activation': activation,
'bn': 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 ResidualConvUnit_custom — 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 ResidualConvUnit_custom 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
|
| ResidualConvUnit_custom |
Ran ran on a synthesized input · constructed an object; no result was computed |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("ad298204d1010625") 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, ResidualConvUnit_custom: 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)
# The function uses:
# - features: int (passed to Conv2d and BatchNorm2d)
# - activation: nn.Module class (instantiated and called as self.activation(x))
# - bn: bool (controls whether BatchNorm layers are created and used)
ARGS = {
"features": 4,
"activation": nn.GELU,
"bn": 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 ResidualConvUnit_custom — 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 ResidualConvUnit_custom 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
|
| Slice |
Ran ran on a synthesized input · constructed an object; no result was computed |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("fe6c12fc56b62097") 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, Slice: 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)
# The Slice module takes a tensor and slices it along dimension 1 starting from start_index
# We need to provide:
# 1. start_index: an integer that determines where to start slicing
# Create a small test tensor with shape (batch=2, features=4)
test_tensor = torch.randn(2, 4)
ARGS = {
"start_index": 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 Slice — 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 Slice 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
|
| Slice |
Ran ran on a synthesized input · constructed an object; no result was computed |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("9bab9be3d22f412a") 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, Slice: 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)
# The Slice module takes start_index as a parameter
# In forward, it takes a tensor x and slices it: x[:, self.start_index:]
# This suggests x is a 2D or higher tensor where we're slicing along dimension 1
# Create a sample input tensor
# Shape: (batch_size=2, sequence_length=5, feature_dim=4)
# This allows us to test the slicing operation
sample_input = torch.randn(2, 5, 4)
ARGS = {
"start_index": 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 Slice — 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 Slice 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
|
| Transpose |
Ran ran on a synthesized input · constructed an object; no result was computed |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("02e1fc79bd830d15") 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, Transpose: 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)
# The Transpose module takes dim0 and dim1 as parameters
# It transposes a tensor along those two dimensions in forward()
# Create a small tensor with distinct dimensions for probing
# Shape: (2, 3, 4, 5) - batch=2, then 3 distinct dimensions
x = torch.randn(2, 3, 4, 5)
# dim0 and dim1 should be valid dimension indices for the input tensor
# Let's use dimensions 1 and 3 to transpose
dim0 = 1
dim1 = 3
ARGS = {
"dim0": dim0,
"dim1": dim1
}
- 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 Transpose — 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 Transpose 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
|
| Transpose |
Ran ran on a synthesized input |
chriswxho/dynamic-inference/dpt/vit.py code served (permissive licence) · get_code("016c70fd7d59aa02") 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, shape (4, 3, 2, 5) 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 Transpose(nn.Module):
def __init__(self, dim0, dim1):
super(Transpose, self).__init__()
self.dim0 = dim0
self.dim1 = dim1
def forward(self, x):
x = x.transpose(self.dim0, self.dim1).contiguous()
return x
INIT_ARGS = {
'dim0': 0,
'dim1': 2,
}
ARGS = {
'x': torch.randn(2, 3, 4, 5),
}
if __name__ == '__main__':
module = Transpose(**INIT_ARGS)
output = module(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
print(f"Expected shape after transposing dims {INIT_ARGS['dim0']} and {INIT_ARGS['dim1']}: (4, 3, 2, 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 4, dtype family float, shape (4, 3, 2, 5) — shape (4, 3, 2, 5) 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)
|
| _get_rel_pos_bias |
Ran ran; our contract draft was wrong, not the code |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("40c8322bb20f356a") 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 Tensor, ndim 4, dtype family float, shape (1, 4, 10, 10) 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
from timm.models.beit import gen_relative_position_index
torch.manual_seed(0)
class MockAttention(nn.Module):
def __init__(self):
super().__init__()
# Original window size
self.window_size = (2, 2)
# Create relative_position_bias_table
# old_height = 2*2 - 1 = 3, old_width = 2*2 - 1 = 3
# old_num_relative_distance = 3 * 3 + 3 = 12
old_height = 2 * self.window_size[0] - 1
old_width = 2 * self.window_size[1] - 1
old_num_relative_distance = old_height * old_width + 3
num_heads = 4
self.relative_position_bias_table = nn.Parameter(
torch.randn(old_num_relative_distance, num_heads)
)
self.num_relative_distance = old_num_relative_distance
self.relative_position_indices = {}
# Create mock self object with all required attributes
mock_self = MockAttention()
# Define the new window size to interpolate to
new_window_size = (3, 3)
ARGS = {
"self": mock_self,
"window_size": new_window_size,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (1, 4, 10, 10) — shape (1, 4, 10, 10) 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
|
| _make_efficientnet_backbone |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("834b7b88350e7ea8") 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 Module. 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 EfficientNet-like mock object
class MockEfficientNet(nn.Module):
def __init__(self):
super().__init__()
self.conv_stem = nn.Conv2d(3, 16, kernel_size=3, padding=1)
self.bn1 = nn.BatchNorm2d(16)
self.act1 = nn.ReLU()
# Create 9 blocks total
self.blocks = nn.ModuleList([
nn.Sequential(nn.Conv2d(16, 24, 3, padding=1), nn.BatchNorm2d(24), nn.ReLU()), # 0
nn.Sequential(nn.Conv2d(24, 24, 3, padding=1), nn.BatchNorm2d(24), nn.ReLU()), # 1
nn.Sequential(nn.Conv2d(24, 40, 3, padding=1), nn.BatchNorm2d(40), nn.ReLU()), # 2
nn.Sequential(nn.Conv2d(40, 40, 3, padding=1), nn.BatchNorm2d(40), nn.ReLU()), # 3
nn.Sequential(nn.Conv2d(40, 80, 3, padding=1), nn.BatchNorm2d(80), nn.ReLU()), # 4
nn.Sequential(nn.Conv2d(80, 80, 3, padding=1), nn.BatchNorm2d(80), nn.ReLU()), # 5
nn.Sequential(nn.Conv2d(80, 112, 3, padding=1), nn.BatchNorm2d(112), nn.ReLU()), # 6
nn.Sequential(nn.Conv2d(112, 112, 3, padding=1), nn.BatchNorm2d(112), nn.ReLU()), # 7
nn.Sequential(nn.Conv2d(112, 192, 3, padding=1), nn.BatchNorm2d(192), nn.ReLU()), # 8
])
effnet = MockEfficientNet()
ARGS = {
"effnet": effnet,
}
- 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_fusion_block |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("102716c661000e36") 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 FeatureFusionBlock_custom. 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 = {
"features": 64,
"use_bn": 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 FeatureFusionBlock_custom — a FeatureFusionBlock_custom output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FeatureFusionBlock_custom 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
|
| _make_fusion_block |
Ran ran; our contract draft was wrong, not the code |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("38836aa31edf05ea") 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 FeatureFusionBlock_custom. 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 = {
"features": 64,
"use_bn": False,
"size": None,
}
- 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 FeatureFusionBlock_custom — a FeatureFusionBlock_custom output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FeatureFusionBlock_custom 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
|
| _make_fusion_block |
Ran ran; our contract draft was wrong, not the code |
EPFL-VILAB/3DCommonCorruptions/models/dpt/dpt.py pointer only (licence: NOASSERTION) · get_code("fdbfcb386c7b2849") How it ranThe body of this sample is withheld: GitHub could not classify the licence of this paper's repository, EPFL-VILAB/3DCommonCorruptions (NOASSERTION). 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. |
| _make_pretrained_efficientnet_lite3 |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("740429d3dc1524e8") 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 Module. 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 mock efficientnet structure that mimics what torch.hub.load would return
class MockEfficientNet(nn.Module):
def __init__(self):
super().__init__()
self.conv_stem = nn.Conv2d(3, 32, kernel_size=3, padding=1)
self.bn1 = nn.BatchNorm2d(32)
self.act1 = nn.ReLU()
# Create mock blocks - we need at least 9 blocks total
self.blocks = nn.ModuleList([
nn.Conv2d(32, 32, 3, padding=1) for _ in range(9)
])
# Since torch.hub.load would normally download, we'll mock it
original_hub_load = torch.hub.load
def mock_hub_load(repo_or_dir, model, pretrained=False, exportable=False, **kwargs):
return MockEfficientNet()
torch.hub.load = mock_hub_load
ARGS = {
"use_pretrained": False,
"exportable": 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_pretrained_resnext101_wsl |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("a8b882224b12ff18") 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 Module. 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
# Mock the torch.hub.load to avoid network calls
original_hub_load = torch.hub.load
def mock_hub_load(repo_or_dir, model, *args, **kwargs):
# Create a mock ResNet-like object with the required attributes
mock_resnet = nn.Module()
mock_resnet.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3)
mock_resnet.bn1 = nn.BatchNorm2d(64)
mock_resnet.relu = nn.ReLU(inplace=True)
mock_resnet.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
# Create mock layer blocks
mock_resnet.layer1 = nn.Sequential(
nn.Conv2d(64, 64, 3, padding=1),
nn.BatchNorm2d(64),
nn.ReLU()
)
mock_resnet.layer2 = nn.Sequential(
nn.Conv2d(64, 128, 3, stride=2, padding=1),
nn.BatchNorm2d(128),
nn.ReLU()
)
mock_resnet.layer3 = nn.Sequential(
nn.Conv2d(128, 256, 3, stride=2, padding=1),
nn.BatchNorm2d(256),
nn.ReLU()
)
mock_resnet.layer4 = nn.Sequential(
nn.Conv2d(256, 512, 3, stride=2, padding=1),
nn.BatchNorm2d(512),
nn.ReLU()
)
return mock_resnet
torch.hub.load = mock_hub_load
torch.manual_seed(0)
ARGS = {
"use_pretrained": 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_resnet_backbone |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("ce472b6674d107a1") 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 Module. 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)
# Build a minimal ResNet-like object with all required attributes
class MinimalResNet(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 4, kernel_size=7, stride=2, padding=3)
self.bn1 = nn.BatchNorm2d(4)
self.relu = nn.ReLU(inplace=True)
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
self.layer1 = nn.Sequential(
nn.Conv2d(4, 8, kernel_size=3, padding=1),
nn.BatchNorm2d(8)
)
self.layer2 = nn.Sequential(
nn.Conv2d(8, 16, kernel_size=3, padding=1),
nn.BatchNorm2d(16)
)
self.layer3 = nn.Sequential(
nn.Conv2d(16, 32, kernel_size=3, padding=1),
nn.BatchNorm2d(32)
)
self.layer4 = nn.Sequential(
nn.Conv2d(32, 64, kernel_size=3, padding=1),
nn.BatchNorm2d(64)
)
resnet = MinimalResNet()
ARGS = {
"resnet": resnet
}
- 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_scratch |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("298bf93c3f6ba329") 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 Module. 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 = {
"in_shape": [64, 128, 256, 512],
"out_shape": 256,
"groups": 1,
"expand": 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_scratch |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("c3d28fbdea77e7e8") 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 Module. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# The function expects:
# - in_shape: a sequence (list/tuple) with at least 3 elements, optionally 4+
# Each element is an integer representing input channels for each layer
# - out_shape: an integer representing the base output shape
# - groups: integer for grouped convolutions (default 1)
# - expand: boolean to control whether output shapes are multiplied
# Case 1: in_shape with 3 elements (no layer4)
in_shape_3 = [64, 128, 256]
out_shape_val = 32
groups_val = 1
expand_val = False
ARGS = {
"in_shape": in_shape_3,
"out_shape": out_shape_val,
"groups": groups_val,
"expand": expand_val,
}
- 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_vit_b16_backbone |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("241aaec48213a78b") 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 Module. 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)
# Create a minimal ViT-like model that has the expected structure
class MinimalViTModel(nn.Module):
def __init__(self):
super().__init__()
self.blocks = nn.ModuleList([
nn.Sequential(nn.Linear(768, 768)) for _ in range(12)
])
self.cls_token = nn.Parameter(torch.randn(1, 1, 768))
self.pos_drop = nn.Dropout(0.1)
def forward(self, x):
return x
class MinimalPatchEmbed(nn.Module):
def __init__(self):
super().__init__()
self.proj = nn.Linear(768, 768)
def forward(self, x):
return x
# Build the minimal ViT model
vit_model = MinimalViTModel()
vit_model.patch_embed = MinimalPatchEmbed()
vit_model.patch_size = [16, 16]
# Add norm layer
vit_model.norm = nn.LayerNorm(768)
# Add _resize_pos_embed method to model
def _resize_pos_embed(self, posemb, gs_h, gs_w):
start_index = 1
posemb_tok, posemb_grid = (posemb[:, :start_index], posemb[0, start_index:])
gs_old = int(math.sqrt(len(posemb_grid)))
posemb_grid = posemb_grid.reshape(1, gs_old, gs_old, -1).permute(0, 3, 1, 2)
posemb_grid = torch.nn.functional.interpolate(posemb_grid, size=(gs_h, gs_w), mode='bilinear')
posemb_grid = posemb_grid.permute(0, 2, 3, 1).reshape(1, gs_h * gs_w, -1)
posemb = torch.cat([posemb_tok, posemb_grid], dim=1)
return posemb
vit_model._resize_pos_embed = _resize_pos_embed.__get__(vit_model, MinimalViTModel)
vit_model.pos_embed = torch.randn(1, 577, 768)
ARGS = {
'model': vit_model,
'features': [96, 192, 384, 768],
'size': [384, 384],
'hooks': [2, 5, 8, 11],
'vit_features': 768,
'use_readout': 'ignore',
'start_index': 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_vit_b16_backbone |
Ran ran; our contract draft was wrong, not the code |
alexeyab/midas/midas/dpt_depth.py code served (permissive licence) · get_code("4bf6704b366125e7") 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 Module. 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)
class MockViTModel(nn.Module):
def __init__(self):
super().__init__()
self.blocks = nn.ModuleList([
nn.TransformerEncoderLayer(d_model=768, nhead=12, batch_first=True)
for _ in range(12)
])
self.cls_token = nn.Parameter(torch.randn(1, 1, 768))
self.pos_embed = nn.Parameter(torch.randn(1, 577, 768))
self.pos_drop = nn.Dropout(0.1)
self.norm = nn.LayerNorm(768)
self.patch_embed = nn.Module()
self.patch_embed.proj = nn.Conv2d(3, 768, kernel_size=16, stride=16)
self.patch_size = [16, 16]
model = MockViTModel()
ARGS = {
'model': model,
'features': [96, 192, 384, 768],
'size': [384, 384],
'hooks': [2, 5, 8, 11],
'vit_features': 768,
'use_readout': 'ignore',
'start_index': 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_vit_b16_backbone |
Ran ran; our contract draft was wrong, not the code |
intel-isl/DPT/dpt/vit.py code served (permissive licence) · get_code("6a1741c5ae2b9d9c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Module. 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)
# Create a minimal ViT-like model that satisfies the function's usage
class MinimalBlock(nn.Module):
def __init__(self, dim=768):
super().__init__()
self.attn = nn.Module()
self.attn.qkv = nn.Linear(dim, dim * 3)
self.attn.num_heads = 12
self.attn.scale = 1.0 / math.sqrt(dim // 12)
self.norm1 = nn.LayerNorm(dim)
self.mlp = nn.Sequential(nn.Linear(dim, dim * 4), nn.GELU(), nn.Linear(dim * 4, dim))
self.norm2 = nn.LayerNorm(dim)
def forward(self, x):
x = x + self.attn(x)
x = x + self.mlp(self.norm2(x))
return x
class MinimalViTModel(nn.Module):
def __init__(self, dim=768, num_blocks=12):
super().__init__()
self.patch_embed = nn.Module()
self.patch_embed.backbone = None
self.patch_embed.proj = nn.Conv2d(3, dim, kernel_size=16, stride=16)
self.cls_token = nn.Parameter(torch.randn(1, 1, dim))
self.dist_token = None
self.pos_embed = nn.Parameter(torch.randn(1, 577, dim)) # 1 + 576 patches for 384x384 with patch_size 16
self.pos_drop = nn.Dropout(0.1)
self.blocks = nn.ModuleList([MinimalBlock(dim) for _ in range(num_blocks)])
self.norm = nn.LayerNorm(dim)
self.patch_size = [16, 16]
def forward(self, x):
return x
# Create model instance
model = MinimalViTModel(dim=768, num_blocks=12)
# Define ARGS dictionary
ARGS = {
'model': model,
'features': [96, 192, 384, 768],
'size': [384, 384],
'hooks': [2, 5, 8, 11],
'vit_features': 768,
'use_readout': 'ignore',
'start_index': 1,
'enable_attention_hooks': False
}
- 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_vit_b16_backbone |
Ran ran; our contract draft was wrong, not the code |
ahmedmostafa0x61/Depth_Estimation/midas/vit.py code served (permissive licence) · get_code("22e02732ff97d26e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Module. 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)
# Create a minimal ViT-like model that satisfies the function's usage
class MinimalViTModel(nn.Module):
def __init__(self):
super().__init__()
self.patch_size = [16, 16]
self.cls_token = nn.Parameter(torch.randn(1, 1, 768))
self.pos_embed = nn.Parameter(torch.randn(1, 577, 768)) # 1 cls + 576 patches for 384x384
self.pos_drop = nn.Dropout(0.1)
# Create 12 transformer blocks (standard ViT-B has 12)
self.blocks = nn.ModuleList([
nn.TransformerEncoderLayer(d_model=768, nhead=12, dim_feedforward=3072, batch_first=True)
for _ in range(12)
])
self.norm = nn.LayerNorm(768)
# Patch embedding
self.patch_embed = nn.Module()
self.patch_embed.proj = nn.Conv2d(3, 768, kernel_size=16, stride=16)
self.patch_embed.backbone = None
# Create a minimal model instance
model = MinimalViTModel()
# Define arguments for _make_vit_b16_backbone
ARGS = {
'model': model,
'features': [96, 192, 384, 768],
'size': [384, 384],
'hooks': [2, 5, 8, 11],
'vit_features': 768,
'use_readout': 'ignore',
'start_index': 1
}
- 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_vit_b16_backbone |
Ran ran; our contract draft was wrong, not the code |
chriswxho/dynamic-inference/dpt/vit.py code served (permissive licence) · get_code("c7da0395e6eeb589") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Module. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import math
torch.manual_seed(0)
# Build a minimal ViT-like model that satisfies the function's usage
class MinimalBlock(nn.Module):
def __init__(self, dim=768):
super().__init__()
self.attn = nn.Module()
self.attn.qkv = nn.Linear(dim, dim * 3)
self.attn.num_heads = 12
self.attn.scale = 1.0 / math.sqrt(dim // 12)
self.norm1 = nn.LayerNorm(dim)
self.mlp = nn.Sequential(nn.Linear(dim, dim * 4), nn.GELU(), nn.Linear(dim * 4, dim))
self.norm2 = nn.LayerNorm(dim)
def forward(self, x):
x = x + self.attn(x)
x = x + self.mlp(self.norm2(x))
return x
class MinimalViT(nn.Module):
def __init__(self, dim=768, num_blocks=12, patch_size=(16, 16)):
super().__init__()
self.patch_size = patch_size
self.cls_token = nn.Parameter(torch.randn(1, 1, dim))
self.pos_embed = nn.Parameter(torch.randn(1, 577, dim)) # 1 cls + 576 patches (24x24)
self.pos_drop = nn.Dropout(0.1)
self.patch_embed = nn.Module()
self.patch_embed.proj = nn.Linear(3 * patch_size[0] * patch_size[1], dim)
self.blocks = nn.ModuleList([MinimalBlock(dim) for _ in range(num_blocks)])
self.norm = nn.LayerNorm(dim)
def forward(self, x):
B = x.shape[0]
x = self.patch_embed.proj(x.flatten(1)).unsqueeze(1)
cls_tokens = self.cls_token.expand(B, -1, -1)
x = torch.cat((cls_tokens, x), dim=1)
x = x + self.pos_embed[:, :x.shape[1]]
x = self.pos_drop(x)
for blk in self.blocks:
x = blk(x)
x = self.norm(x)
return x
# Create a minimal ViT model
vit_model = MinimalViT(dim=768, num_blocks=12, patch_size=(16, 16))
# Build ARGS dictionary
ARGS = {
'model': vit_model,
'features': [96, 192, 384, 768],
'size': [384, 384],
'hooks': [2, 5, 8, 11],
'vit_features': 768,
'use_readout': 'ignore',
'start_index': 1,
'enable_attention_hooks': False
}
- 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_vit_b16_backbone |
Ran ran; our contract draft was wrong, not the code |
EPFL-VILAB/3DCommonCorruptions/models/dpt/dpt.py pointer only (licence: NOASSERTION) · get_code("fd1f3e21f29de65e") How it ranThe body of this sample is withheld: GitHub could not classify the licence of this paper's repository, EPFL-VILAB/3DCommonCorruptions (NOASSERTION). 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. |
| _make_vit_b_rn50_backbone |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
alexeyab/midas/midas/dpt_depth.py code served (permissive licence) · get_code("27ca85b22f1e4944") 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 Module. 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)
# Create a minimal ViT-like model that has the structure expected by the function
class MinimalPatchEmbed(nn.Module):
def __init__(self):
super().__init__()
self.backbone = nn.ModuleDict({
'stages': nn.ModuleList([
nn.Sequential(nn.Conv2d(3, 64, 1)),
nn.Sequential(nn.Conv2d(64, 128, 1))
])
})
self.proj = nn.Conv2d(128, 768, 1)
class MinimalBlock(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(768, 768)
def forward(self, x):
return self.linear(x)
class MinimalViTModel(nn.Module):
def __init__(self):
super().__init__()
self.patch_size = [16, 16]
self.patch_embed = MinimalPatchEmbed()
self.cls_token = nn.Parameter(torch.randn(1, 1, 768))
self.pos_embed = nn.Parameter(torch.randn(1, 577, 768)) # 1 + 24*24
self.pos_drop = nn.Dropout(0.1)
self.blocks = nn.ModuleList([MinimalBlock() for _ in range(12)])
self.norm = nn.LayerNorm(768)
def _resize_pos_embed(self, posemb, gs_h, gs_w):
posemb_tok = posemb[:, :1]
posemb_grid = posemb[0, 1:]
gs_old = int(math.sqrt(len(posemb_grid)))
posemb_grid = posemb_grid.reshape(1, gs_old, gs_old, -1).permute(0, 3, 1, 2)
posemb_grid = torch.nn.functional.interpolate(posemb_grid, size=(gs_h, gs_w), mode='bilinear')
posemb_grid = posemb_grid.permute(0, 2, 3, 1).reshape(1, gs_h * gs_w, -1)
posemb = torch.cat([posemb_tok, posemb_grid], dim=1)
return posemb
def forward(self, x):
b, c, h, w = x.shape
pos_embed = self._resize_pos_embed(self.pos_embed, h // self.patch_size[1], w // self.patch_size[0])
B = x.shape[0]
x = self.patch_embed.backbone['stages'][0](x)
x = self.patch_embed.backbone['stages'][1](x)
x = self.patch_embed.proj(x).flatten(2).transpose(1, 2)
cls_tokens = self.cls_token.expand(B, -1, -1)
x = torch.cat((cls_tokens, x), dim=1)
x = x + pos_embed
x = self.pos_drop(x)
for blk in self.blocks:
x = blk(x)
x = self.norm(x)
return x
# Create model instance
model = MinimalViTModel()
ARGS = {
'model': model,
'features': [256, 512, 768, 768],
'size': [384, 384],
'hooks': [0, 1, 8, 11],
'vit_features': 768,
'use_vit_only': False,
'use_readout': 'ignore',
'start_index': 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 Module — a Module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Module 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
|
| _make_vit_b_rn50_backbone |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
EPFL-VILAB/3DCommonCorruptions/models/dpt/dpt.py pointer only (licence: NOASSERTION) · get_code("97b2384833631e16") How it ranThe body of this sample is withheld: GitHub could not classify the licence of this paper's repository, EPFL-VILAB/3DCommonCorruptions (NOASSERTION). 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. |
| _resize_pos_embed |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("cfe5d2133bdce329") 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 Tensor, ndim 3, dtype family float, shape (1, 5, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import math
torch.manual_seed(0)
class MockVisionTransformer(nn.Module):
def __init__(self):
super().__init__()
self.start_index = 1
def _resize_pos_embed(self, posemb, gs_h, gs_w):
posemb_tok, posemb_grid = (posemb[:, :self.start_index], posemb[0, self.start_index:])
gs_old = int(math.sqrt(len(posemb_grid)))
posemb_grid = posemb_grid.reshape(1, gs_old, gs_old, -1).permute(0, 3, 1, 2)
import torch.nn.functional as F
posemb_grid = F.interpolate(posemb_grid, size=(gs_h, gs_w), mode='bilinear')
posemb_grid = posemb_grid.permute(0, 2, 3, 1).reshape(1, gs_h * gs_w, -1)
posemb = torch.cat([posemb_tok, posemb_grid], dim=1)
return posemb
# Create mock self object
mock_self = MockVisionTransformer()
# Create posemb tensor: batch_size=1, seq_len=10 (1 token + 9 grid positions), embed_dim=4
# start_index=1, so posemb_tok has shape (1, 1, 4) and posemb_grid has 9 positions (3x3 grid)
posemb = torch.randn(1, 10, 4)
# Target grid dimensions (resize to 2x2)
gs_h = 2
gs_w = 2
ARGS = {
'self': mock_self,
'posemb': posemb,
'gs_h': gs_h,
'gs_w': gs_w
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (1, 5, 4) — shape (1, 5, 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
|
| _resize_pos_embed |
Ran ran; our contract draft was wrong, not the code |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("343394f583ca241e") 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 Tensor, ndim 3, dtype family float, shape (1, 37, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import math
import torch.nn.functional as F
torch.manual_seed(0)
class MockModel:
def __init__(self):
self.start_index = 2
# Create mock self object
mock_self = MockModel()
# Create position embedding tensor
# Format: [batch_size, num_tokens, embedding_dim]
# num_tokens = start_index (2 cls/special tokens) + grid_tokens (9 = 3x3)
# So total sequence length should be 11
embedding_dim = 4
start_index = 2
gs_old = 3 # old grid size 3x3
grid_tokens = gs_old * gs_old # 9 tokens
# posemb shape: [1, 11, 4]
# First 2 are token embeddings, remaining 9 are grid embeddings
posemb = torch.randn(1, start_index + grid_tokens, embedding_dim)
# New grid sizes
gs_h = 5
gs_w = 7
ARGS = {
"self": mock_self,
"posemb": posemb,
"gs_h": gs_h,
"gs_w": gs_w
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (1, 37, 4) — shape (1, 37, 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
|
| a_cosine_learning_rate |
Ran ran, honoured the contract we drafted |
mszpc/3d_dense/3d_densenet/src/lr_schedule.py code served (permissive licence) · get_code("7323023300272262") 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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import math
import torch
torch.manual_seed(0)
# Analyzing the function:
# - current_step: int, used in arithmetic operations
# - base_lr: float, used in arithmetic operations
# - warmup_steps: int, used in arithmetic operations
# - decay_steps: int, used in arithmetic operations
# All parameters are scalar numeric values
ARGS = {
"current_step": 100,
"base_lr": 0.001,
"warmup_steps": 10,
"decay_steps": 90,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| beit_forward_features |
Ran ran; our contract draft was wrong, not the code |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("fb4a75a755978b87") 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 Tensor, ndim 3, dtype family float, shape (2, 10, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
from torch.nn.modules.module import Module
torch.manual_seed(0)
# Build minimal mock blocks that match the function's usage
class MockBlock(nn.Module):
def __init__(self, dim=4):
super().__init__()
self.linear = nn.Linear(dim, dim)
def forward(self, x, resolution=None, shared_rel_pos_bias=None):
return self.linear(x)
class MockPatchEmbed(nn.Module):
def __init__(self, embed_dim=4):
super().__init__()
self.embed_dim = embed_dim
def forward(self, x):
# Input: (B, C, H, W) -> Output: (B, num_patches, embed_dim)
B = x.shape[0]
# Flatten spatial and return (B, num_patches, embed_dim)
return torch.randn(B, 9, self.embed_dim)
class MockRelPosBias(nn.Module):
def forward(self):
return None
class MockNorm(nn.Module):
def __init__(self, dim=4):
super().__init__()
self.norm = nn.LayerNorm(dim)
def forward(self, x):
return self.norm(x)
class MockBeitModel(nn.Module):
def __init__(self):
super().__init__()
self.patch_embed = MockPatchEmbed(embed_dim=4)
self.cls_token = nn.Parameter(torch.randn(1, 1, 4))
self.pos_embed = nn.Parameter(torch.randn(1, 10, 4))
self.pos_drop = nn.Dropout(0.1)
self.rel_pos_bias = MockRelPosBias()
self.blocks = nn.ModuleList([MockBlock(dim=4) for _ in range(2)])
self.norm = MockNorm(dim=4)
self.grad_checkpointing = False
# Create model instance
model = MockBeitModel()
# Create input tensor: (batch=2, channels=3, height=8, width=8)
x = torch.randn(2, 3, 8, 8)
ARGS = {
"self": model,
"x": x,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 10, 4) — shape (2, 10, 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
|
| block_forward |
Ran ran; our contract draft was wrong, not the code |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("75608d4281abdc41") 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 Tensor, ndim 3, dtype family float, shape (2, 5, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
from typing import Optional
torch.manual_seed(0)
class MockAttention(nn.Module):
def __init__(self, dim=4):
super().__init__()
self.dim = dim
def forward(self, x, resolution, shared_rel_pos_bias=None):
return torch.zeros_like(x)
class MockMLP(nn.Module):
def __init__(self, dim=4):
super().__init__()
self.dim = dim
def forward(self, x):
return torch.zeros_like(x)
class MockNorm(nn.Module):
def __init__(self, dim=4):
super().__init__()
self.dim = dim
def forward(self, x):
return x
class MockDropPath(nn.Module):
def forward(self, x):
return x
class MockBlock(nn.Module):
def __init__(self, dim=4, use_gamma=False):
super().__init__()
self.attn = MockAttention(dim)
self.mlp = MockMLP(dim)
self.norm1 = MockNorm(dim)
self.norm2 = MockNorm(dim)
self.drop_path = MockDropPath()
if use_gamma:
self.gamma_1 = nn.Parameter(torch.tensor(0.5))
self.gamma_2 = nn.Parameter(torch.tensor(0.5))
else:
self.gamma_1 = None
self.gamma_2 = None
block = MockBlock(dim=4, use_gamma=False)
x = torch.randn(2, 5, 4)
resolution = (5, 5)
shared_rel_pos_bias = torch.randn(2, 3, 5, 5)
ARGS = {
"self": block,
"x": x,
"resolution": resolution,
"shared_rel_pos_bias": shared_rel_pos_bias
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 5, 4) — shape (2, 5, 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
|
| convert_label |
Ran ran on a synthesized input |
mszpc/3d_dense/3d_densenet/src/prepare_hdf5_cutedge.py code served (permissive licence) · get_code("0b597d0a009b7195") 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 ndarray, ndim 3, dtype family int, shape (4, 5, 2) 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 numpy as np
# Create a small 3D label image with shape (4, 5, 2)
# The function expects a 3D array where it iterates over the third dimension
label_img = np.zeros((4, 5, 2), dtype=np.uint8)
# Add some values that will be converted
label_img[0, 0, 0] = 10
label_img[1, 1, 0] = 150
label_img[2, 2, 1] = 250
label_img[3, 3, 1] = 10
ARGS = {
"label_img": label_img
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 3, dtype family int, shape (4, 5, 2) — shape (4, 5, 2) 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
|
| cut_edge |
Ran ran on a synthesized input |
mszpc/3d_dense/3d_densenet/src/prepare_hdf5_cutedge.py code served (permissive licence) · get_code("161a84017220777a") 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 tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# Create a 3D tensor with some non-zero values and zero-padded edges
# Shape: (D=6, H=5, W=4)
data = torch.zeros(6, 5, 4)
# Fill interior with non-zero values
data[2:4, 1:4, 1:3] = torch.randn(2, 3, 2)
# Convert to numpy array since the function uses .sum() and indexing
data = data.numpy()
keep_margin = 1
ARGS = {
"data": data,
"keep_margin": keep_margin
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| dynamic_lr |
Ran ran, honoured the contract we drafted |
mszpc/3d_dense/3d_densenet/src/lr_schedule.py code served (permissive licence) · get_code("a2d30739f5546b64") 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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
class Config:
def __init__(self):
self.lr = 0.001
self.epoch_size = 100
self.warmup_step = 10
self.warmup_ratio = 0.1
config = Config()
base_step = 2
ARGS = {
"config": config,
"base_step": base_step,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- 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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| eval_dice |
Ran ran on a synthesized input |
mszpc/3d_dense/3d_densenet/src/metrics.py code served (permissive licence) · get_code("142b50e484a4ca92") 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 float64, 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 numpy as np
# Create small numpy arrays for testing
# im1 and im2 should be arrays with some label values
im1 = np.array([[1, 2, 1, 3],
[2, 1, 2, 1],
[3, 1, 2, 3]])
im2 = np.array([[1, 2, 1, 3],
[2, 1, 3, 1],
[3, 1, 2, 3]])
# tid is the tissue/target ID to compute Dice for
tid = 1
ARGS = {
'im1': im1,
'im2': im2,
'tid': tid
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| forward_flex |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("bf8342ed43aa9fb3") 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 Tensor, ndim 3, dtype family float, shape (2, 17, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Build a minimal patch embedding module
class PatchEmbedding(nn.Module):
def __init__(self, in_channels, embed_dim, patch_size):
super().__init__()
self.proj = nn.Conv2d(in_channels, embed_dim, kernel_size=patch_size, stride=patch_size)
def forward(self, x):
return self.proj(x)
# Build a minimal transformer block
class TransformerBlock(nn.Module):
def __init__(self, dim):
super().__init__()
self.norm = nn.LayerNorm(dim)
self.mlp = nn.Sequential(
nn.Linear(dim, dim * 2),
nn.GELU(),
nn.Linear(dim * 2, dim)
)
def forward(self, x):
x = x + self.mlp(self.norm(x))
return x
# Build the model class that forward_flex belongs to
class VisionTransformer(nn.Module):
def __init__(self):
super().__init__()
self.patch_size = (8, 8) # (height_patch_size, width_patch_size)
embed_dim = 4
num_patches_h = 4
num_patches_w = 4
# Patch embedding
self.patch_embed = PatchEmbedding(in_channels=3, embed_dim=embed_dim, patch_size=8)
# Class token and position embedding
self.cls_token = nn.Parameter(torch.randn(1, 1, embed_dim))
self.pos_embed = nn.Parameter(torch.randn(1, num_patches_h * num_patches_w + 1, embed_dim))
# Optional dist_token (not set here, so getattr will return None)
# Position dropout
self.pos_drop = nn.Dropout(0.0)
# Transformer blocks
self.blocks = nn.ModuleList([
TransformerBlock(embed_dim),
TransformerBlock(embed_dim)
])
# Final layer norm
self.norm = nn.LayerNorm(embed_dim)
def _resize_pos_embed(self, pos_embed, h, w):
# Simple stand-in: just return pos_embed without resizing
# In real code this would interpolate, but for testing we keep it simple
return pos_embed
def forward_flex(self, x):
b, c, h, w = x.shape
pos_embed = self._resize_pos_embed(self.pos_embed, h // self.patch_size[1], w // self.patch_size[0])
B = x.shape[0]
if hasattr(self.patch_embed, 'backbone'):
x = self.patch_embed.backbone(x)
if isinstance(x, (list, tuple)):
x = x[-1]
x = self.patch_embed.proj(x).flatten(2).transpose(1, 2)
if getattr(self, 'dist_token', None) is not None:
cls_tokens = self.cls_token.expand(B, -1, -1)
dist_token = self.dist_token.expand(B, -1, -1)
x = torch.cat((cls_tokens, dist_token, x), dim=1)
else:
cls_tokens = self.cls_token.expand(B, -1, -1)
x = torch.cat((cls_tokens, x), dim=1)
x = x + pos_embed
x = self.pos_drop(x)
for blk in self.blocks:
x = blk(x)
x = self.norm(x)
return x
# Create model instance
model = VisionTransformer()
# Create input tensor: batch_size=2, channels=3, height=32, width=32
x = torch.randn(2, 3, 32, 32)
# Define ARGS
ARGS = {
'self': model,
'x': x
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 17, 4) — shape (2, 17, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| forward_levit |
Ran ran; our contract draft was wrong, not the code |
intel-isl/MiDaS/midas/dpt_depth.py code served (permissive licence) · get_code("71e1ef3cbdd67c09") 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 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
torch.manual_seed(0)
class MockActivationStore(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x
class MockPostProcess(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x
class MockModel(nn.Module):
def __init__(self):
super().__init__()
def forward_features(self, x):
pass
class MockPretrained(nn.Module):
def __init__(self):
super().__init__()
self.model = MockModel()
self.act_postprocess1 = MockPostProcess()
self.act_postprocess2 = MockPostProcess()
self.act_postprocess3 = MockPostProcess()
self.activations = {
'1': torch.randn(2, 4, 3, 5),
'2': torch.randn(2, 4, 3, 6),
'3': torch.randn(2, 4, 3, 7)
}
pretrained = MockPretrained()
x = torch.randn(2, 3, 4, 5)
ARGS = {
'pretrained': pretrained,
'x': x
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_activation |
Ran ran; our contract draft was wrong, not the code |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("1c094193a4506a40") 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 function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# The function get_activation takes a single parameter: name
# It returns a hook function that captures activations by name
# The hook function itself takes (model, input, output) but we only need to
# construct arguments for get_activation, which just needs a name string
ARGS = {
"name": "layer_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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_attention |
Ran ran; our contract draft was wrong, not the code |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("bff5f6006054f011") 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 function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
class MockAttentionModule(nn.Module):
def __init__(self, dim=4, num_heads=2):
super().__init__()
self.dim = dim
self.num_heads = num_heads
self.head_dim = dim // num_heads
self.scale = self.head_dim ** -0.5
# to_qkv projects input to query, key, value
self.to_qkv = nn.Linear(dim, dim * 3)
def forward(self, x):
return self.to_qkv(x)
# Create a mock module instance
module = MockAttentionModule(dim=4, num_heads=2)
# Create a hook function by calling get_attention with a name
attention = {}
def get_attention(name):
def hook(module, input, output):
x = input[0]
B, N, C = x.shape
qkv = module.to_qkv(x).reshape(B, N, 3, module.num_heads, C // module.num_heads).permute(2, 0, 3, 1, 4)
q, k, v = (qkv[0], qkv[1], qkv[2])
attn = q @ k.transpose(-2, -1) * module.scale
attn = attn.softmax(dim=-1)
attention[name] = attn
return hook
ARGS = {
"name": "layer_0"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_attention |
Ran ran; our contract draft was wrong, not the code |
intel-isl/DPT/dpt/vit.py code served (permissive licence) · get_code("a552c8f30bbe3f97") 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 function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Build a minimal Vision Transformer attention module
class AttentionModule(nn.Module):
def __init__(self, dim, num_heads):
super().__init__()
self.num_heads = num_heads
self.dim = dim
self.head_dim = dim // num_heads
self.scale = self.head_dim ** -0.5
# qkv projection: projects dim -> 3*dim
self.qkv = nn.Linear(dim, 3 * dim)
def forward(self, x):
return x
# Create a small attention module
# B=2 (batch), N=3 (sequence length), C=4 (channel/embed dim)
dim = 4
num_heads = 2
attention_module = AttentionModule(dim=dim, num_heads=num_heads)
# Create input tensor: (B, N, C) = (2, 3, 4)
x = torch.randn(2, 3, 4)
# The name parameter is just a string identifier
name = "layer_0"
ARGS = {
"name": name
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_attention |
Ran ran; our contract draft was wrong, not the code |
chriswxho/dynamic-inference/dpt/vit.py code served (permissive licence) · get_code("4d648fedb953ed8e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Create a minimal Vision Transformer attention module that matches the hook's expectations
class MinimalAttention(nn.Module):
def __init__(self, dim=4, num_heads=2):
super().__init__()
self.num_heads = num_heads
self.dim = dim
self.head_dim = dim // num_heads
self.scale = self.head_dim ** -0.5
self.qkv = nn.Linear(dim, dim * 3)
def forward(self, x):
return x
# Create the hook function
attention = {}
def get_attention(name):
def hook(module, input, output):
x = input[0]
B, N, C = x.shape
qkv = module.qkv(x).reshape(B, N, 3, module.num_heads, C // module.num_heads).permute(2, 0, 3, 1, 4)
q, k, v = (qkv[0], qkv[1], qkv[2])
attn = (q @ k.transpose(-2, -1)).contiguous() * module.scale
attn = attn.softmax(dim=-1)
attention[name] = attn
return hook
# Create a minimal attention module
module = MinimalAttention(dim=4, num_heads=2)
# Create input tensor: (batch=2, num_tokens=3, channels=4)
x = torch.randn(2, 3, 4)
# Register the hook
hook_fn = get_attention("test_attention")
module.register_forward_hook(hook_fn)
# Execute the module to trigger the hook
_ = module(x)
# Define ARGS
ARGS = {
"name": "test_attention"
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_readout_oper |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vishal-kataria/MiDaS-master/midas/dpt_depth.py code served (permissive licence) · get_code("2746e456285adbe2") 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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define the modules from the function
class AddReadout(nn.Module):
def __init__(self, start_index=1):
super(AddReadout, self).__init__()
self.start_index = start_index
def forward(self, x):
if self.start_index == 2:
readout = (x[:, 0] + x[:, 1]) / 2
else:
readout = x[:, 0]
return x[:, self.start_index:] + readout.unsqueeze(1)
class ProjectReadout(nn.Module):
def __init__(self, in_features, start_index=1):
super(ProjectReadout, self).__init__()
self.start_index = start_index
self.project = nn.Sequential(nn.Linear(2 * in_features, in_features), nn.GELU())
def forward(self, x):
readout = x[:, 0].unsqueeze(1).expand_as(x[:, self.start_index:])
features = torch.cat((x[:, self.start_index:], readout), -1)
return self.project(features)
class Slice(nn.Module):
def __init__(self, start_index=1):
super(Slice, self).__init__()
self.start_index = start_index
def forward(self, x):
return x[:, self.start_index:]
def get_readout_oper(vit_features, features, use_readout, start_index=1):
if use_readout == 'ignore':
readout_oper = [Slice(start_index)] * len(features)
elif use_readout == 'add':
readout_oper = [AddReadout(start_index)] * len(features)
elif use_readout == 'project':
readout_oper = [ProjectReadout(vit_features, start_index) for out_feat in features]
else:
assert False, "wrong operation for readout token, use_readout can be 'ignore', 'add', or 'project'"
return readout_oper
# Setup arguments for the function
ARGS = {
'vit_features': 64,
'features': [32, 48, 56],
'use_readout': 'project',
'start_index': 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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_readout_oper |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
SforAiDl/vformer/vformer/models/dense/dpt.py code served (permissive licence) · get_code("df2cf6157ba6bfe8") 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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
'vit_features': 768,
'features': [256, 512, 1024],
'use_readout': 'project',
'start_index': 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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_upsampling_weight |
Ran ran on a synthesized input |
mszpc/3d_dense/3d_densenet/src/common.py code served (permissive licence) · get_code("6526250e4bf3fb22") 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 ndarray, ndim 5, dtype family float, shape (3, 2, 5, 5, 5) 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 numpy as np
# Analyze the function signature and body:
# - in_channels: used in range(1, in_channels) and as first dimension index
# - out_channels: used as second dimension
# - kernel_size: used in np.zeros shape and in range loops
# All parameters are integers used to create a numpy array and iterate.
ARGS = {
"in_channels": 3,
"out_channels": 2,
"kernel_size": 5
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 5, dtype family float, shape (3, 2, 5, 5, 5) — shape (3, 2, 5, 5, 5) 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
|
| linear_warmup_learning_rate |
Ran ran, honoured the contract we drafted |
mszpc/3d_dense/3d_densenet/src/lr_schedule.py code served (permissive licence) · get_code("22bcde3a70606484") 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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
ARGS = {
"current_step": 5,
"warmup_steps": 10,
"base_lr": 0.001,
"init_lr": 0.00001
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| merge |
Ran ran; our contract draft was wrong, not the code |
mszpc/3d_dense/3d_densenet/src/model_utils/config.py code served (permissive licence) · get_code("b9e24c3e3e0e88a7") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import argparse
torch.manual_seed(0)
# Create a mock args object with some attributes
args = argparse.Namespace(
learning_rate=0.001,
batch_size=32,
epochs=10,
model_name="test_model",
debug=True,
seed=42
)
# Create a base configuration dictionary
cfg = {
"default_lr": 0.0001,
"default_batch": 16,
"dataset": "cifar10"
}
ARGS = {
"args": args,
"cfg": cfg
}
- 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| one_hot |
Ran ran on a synthesized input |
mszpc/3d_dense/3d_densenet/src/common.py code served (permissive licence) · get_code("c3d563ce6492d0a5") 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 ndarray, ndim 5, dtype family int, shape (2, 4, 3, 4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# The function expects a labels object with:
# - .data attribute
# - .cpu() method
# - .numpy() method
# The result should be a numpy array with shape (batch, height, width, depth)
# We'll create a simple torch tensor as the labels object
labels = torch.randint(0, 4, (2, 3, 4, 5))
ARGS = {
"labels": labels
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 5, dtype family int, shape (2, 4, 3, 4, 5) — shape (2, 4, 3, 4, 5) 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
|