| Clip |
Ran ran on a synthesized input |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("0ef9795780017495") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
class Clip(nn.Module):
def forward(self, x):
return torch.clip(x, -1, 1)
INIT_ARGS = {}
ARGS = {
'x': torch.tensor([[-2.0, -0.5, 0.5, 2.0],
[-3.0, 0.0, 1.5, 1.0]])
}
if __name__ == '__main__':
model = Clip(**INIT_ARGS)
output = model(**ARGS)
print(output)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| LayerNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("6ca16d3e5b87ea81") 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, LayerNorm: 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
from torch import nn
torch.manual_seed(0)
ARGS = {
"dim": 4,
"eps": 0.001,
"device": 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 LayerNorm — 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 LayerNorm 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
|
| Mask |
Ran ran on a synthesized input · constructed an object; no result was computed |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("81c4e3c85779a38b") 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, Mask: 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
torch.manual_seed(0)
# Create test tensors for Mask construction
values_tensor = torch.tensor([[1.0, 1.0, 0.0, 1.0],
[1.0, 0.0, 1.0, 1.0]])
count_tensor = torch.tensor(3.0)
complete_flag = False
ARGS = {
"values": values_tensor,
"count": count_tensor,
"complete": complete_flag
}
- 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 Mask — 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 Mask 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
|
| Sign |
Ran ran on a synthesized input |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("82abe86d62c22ea4") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
class Sign(nn.Module):
def forward(self, x):
return torch.sign(x)
INIT_ARGS = {}
ARGS = {
'x': torch.tensor([[-2.5, -1.0, 0.0, 1.5], [3.2, -0.5, 0.0, -4.1]])
}
if __name__ == '__main__':
model = Sign(**INIT_ARGS)
output = model(**ARGS)
print(output)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| VectorMLP |
Ran ran on a synthesized input · constructed an object; no result was computed |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("1802a24ad0e1881d") 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, VectorMLP: 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_dim': 4,
'out_dim': 3,
'dims': '8-6',
'norm': 'layer',
'act': 'relu',
'init': 'normal',
'out_bias': True,
'out_norm': False,
'objective': 'l2',
'device': 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 VectorMLP — 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 VectorMLP 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_factory |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("fe3e20372d4c072c") 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 partial. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import functools
torch.manual_seed(0)
# Define some factory functions to populate the factories dict
def factory_a(param1=None, param2=None):
return f"FactoryA(param1={param1}, param2={param2})"
def factory_b(param3=None):
return f"FactoryB(param3={param3})"
def factory_c():
return "FactoryC()"
# Create the factories dictionary
factories = {
'type_a': factory_a,
'type_b': factory_b,
'type_c': factory_c,
}
# Test case 1: value as string
value_string = 'type_a'
# Test case 2: value as dict with 'type' key
value_dict = {
'type': 'type_b',
'param3': 'test_value'
}
# Test case 3: value as dict with custom key_id
value_dict_custom = {
'factory_type': 'type_c'
}
ARGS = {
'factories': factories,
'value': value_string,
'key_id': 'type'
}
- 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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| activation |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("afb336dc19e6c757") 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 ReLU. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
import functools
class Clip(nn.Module):
def forward(self, x):
return torch.clip(x, -1, 1)
class Sign(nn.Module):
def forward(self, x):
return torch.sign(x)
_acts = {'none': lambda: None, 'relu': lambda: nn.ReLU(), 'silu': lambda: nn.SiLU(), 'sign': lambda: Sign(), 'clip': lambda: Clip()}
def _build_module(factories, value, *args, none_identity=True, key_id='type', extra_kwargs=None):
factory = _get_factory(factories, value, key_id)
if extra_kwargs is None:
extra_kwargs = dict()
result = factory(*args, **extra_kwargs)
if result is None and none_identity:
result = nn.Identity()
return result
def _get_factory(factories, value, key_id='type'):
if isinstance(value, str):
key = value
kwargs = {}
elif isinstance(value, dict):
kwargs = dict(value)
key = kwargs.pop(key_id)
else:
raise ValueError(type(value))
return functools.partial(factories[key], **kwargs)
def activation(act, none_identity=True):
return _build_module(_acts, act, none_identity=none_identity)
torch.manual_seed(0)
ARGS = {
'act': 'relu',
'none_identity': 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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
|
| bins |
Ran ran, honoured the contract we drafted |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("08417eca38375681") 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 1, dtype family float, shape (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
torch.manual_seed(0)
ARGS = {
"low": 0.0,
"high": 10.0,
"num": 5,
"device": 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 Tensor, ndim 1, dtype family float, shape (5,) — shape (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
|
| cnn |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("e616246bc18fd1b5") 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
from torch import nn
import math
torch.manual_seed(0)
# Define the custom modules used in the function
class Clip(nn.Module):
def forward(self, x):
return torch.clip(x, -1, 1)
class LayerNorm(nn.LayerNorm):
def __init__(self, dim, eps=0.001, device=None):
super().__init__((dim,), eps, device=device)
def forward(self, x):
if x.ndim == 4:
u = x.mean(1, keepdim=True)
xmu = x - u
s = xmu.square().mean(1, keepdim=True)
x = xmu / torch.sqrt(s + self.eps)
out = self.weight[:, None, None] * x + self.bias[:, None, None]
else:
out = super().forward(x)
return out
class Sign(nn.Module):
def forward(self, x):
return torch.sign(x)
# Helper functions
def parse_dims(dims):
if isinstance(dims, str):
dims = tuple((int(d) for d in dims.split('-')))
elif isinstance(dims, int):
dims = (dims,)
return dims
def activation(act, none_identity=True):
_acts = {'none': lambda: None, 'relu': lambda: nn.ReLU(), 'silu': lambda: nn.SiLU(), 'sign': lambda: Sign(), 'clip': lambda: Clip()}
result = _acts[act]()
if result is None and none_identity:
result = nn.Identity()
return result
def norm_2d(norm, d, device=None, none_identity=True):
_norms_2d = {'none': lambda d, device=None: None, 'batch': lambda d, **kwargs: nn.BatchNorm2d(d, **kwargs), 'layer': lambda d, **kwargs: LayerNorm(d, **kwargs)}
result = _norms_2d[norm](d, device=device)
if result is None and none_identity:
result = nn.Identity()
return result
# Define arguments for the cnn function
ARGS = {
'in_dim': 3,
'in_res': 32,
'out_dim': 10,
'channels': '16-32',
'kernels': '3-3',
'strides': '1-2',
'paddings': '1-1',
'norm': 'batch',
'act': 'relu',
'init': 'normal',
'out_bias': True,
'out_norm': 'none',
'memory_format': None,
'device': 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 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
|
| device |
Ran ran; our contract draft was wrong, not the code · constructed an object; no result was computed |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("e332d55367824ddd") 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, device: 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 SimpleModule(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 3)
def forward(self, x):
return self.linear(x)
mod = SimpleModule()
ARGS = {
"mod": mod
}
- 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 device — 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 device 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_mask |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("d31e9b2f069596f5") 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 Mask. 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
torch.manual_seed(0)
# The get_mask function takes a single parameter: values
# which should be a tensor. Looking at the function body:
# - It calls .detach() on values
# - It checks if values.dtype == torch.bool
# - It may convert to float
# - It accesses values.ndim
# - It calls .sum() on values
# We'll create a small tensor to test with
# Test case 1: boolean tensor (complete mask)
values_bool_complete = torch.ones(2, 4, dtype=torch.bool)
# Test case 2: boolean tensor (incomplete mask)
values_bool_incomplete = torch.tensor([[True, False, True, False],
[True, True, False, False]], dtype=torch.bool)
# Test case 3: float tensor
values_float = torch.randn(2, 4, dtype=torch.float)
# Test case 4: integer tensor
values_int = torch.randint(0, 2, (2, 4), dtype=torch.int32)
# We'll use the boolean incomplete case as the primary test
ARGS = {
"values": values_bool_incomplete
}
- 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 Mask — a Mask output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Mask 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
|
| hinge |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("15ba315adfdfafd6") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn.functional as F
torch.manual_seed(0)
# The hinge function takes two parameters: x and target
# Both are used with F.relu(target - x), so they should be tensors
# that can be subtracted and passed to relu
x = torch.randn(2, 4)
target = torch.randn(2, 4)
ARGS = {
"x": x,
"target": target
}
- 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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| init_ |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("29899c0203809b63") 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 SimpleModule. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
import math
torch.manual_seed(0)
class SimpleModule(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 3)
self.bn = nn.BatchNorm1d(3)
def forward(self, x):
return self.bn(self.linear(x))
mod = SimpleModule()
ARGS = {
'mod': mod,
'init': 'normal'
}
- 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 SimpleModule — a SimpleModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModule 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
|
| map_structure |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("dce31dd97728c79d") 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 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 numpy as np
torch.manual_seed(0)
def example_fn(x):
"""A simple function that operates on leaf values."""
if isinstance(x, torch.Tensor):
return x * 2
elif isinstance(x, (int, float)):
return x + 1
else:
return str(x)
# Construct test values with nested structures
nested_list = [1, 2.5, torch.tensor([1.0, 2.0, 3.0, 4.0])]
nested_dict = {
"a": 10,
"b": torch.tensor([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]]),
"c": "test"
}
nested_mixed = {
"tensors": [torch.tensor([1.0, 2.0, 3.0, 4.0]), torch.tensor([5.0, 6.0, 7.0, 8.0])],
"scalars": (42, 3.14),
"nested": {
"value": None,
"data": torch.tensor([0.1, 0.2, 0.3, 0.4])
}
}
ARGS = {
"fn": example_fn,
"value": nested_mixed,
"skip_none": True
}
- 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 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
|
| mlp |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("82d342964b41dc7f") 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
from torch import nn
import math
torch.manual_seed(0)
# Define ARGS dict with all parameters for the mlp function
ARGS = {
'in_dim': 10,
'dims': '16-32-8',
'norm': 'layer',
'act': 'relu',
'init': 'normal',
'out_bias': True,
'out_norm': False,
'device': 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 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
|
| norm_1d |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("4eb2fb2d744ed08b") 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 LayerNorm. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
import functools
torch.manual_seed(0)
class LayerNorm(nn.LayerNorm):
def __init__(self, dim, eps=0.001, device=None):
super().__init__((dim,), eps, device=device)
def forward(self, x):
if x.ndim == 4:
u = x.mean(1, keepdim=True)
xmu = x - u
s = xmu.square().mean(1, keepdim=True)
x = xmu / torch.sqrt(s + self.eps)
out = self.weight[:, None, None] * x + self.bias[:, None, None]
else:
out = super().forward(x)
return out
def _get_factory(factories, value, key_id='type'):
if isinstance(value, str):
key = value
kwargs = {}
elif isinstance(value, dict):
kwargs = dict(value)
key = kwargs.pop(key_id)
else:
raise ValueError(type(value))
return functools.partial(factories[key], **kwargs)
def _build_module(factories, value, *args, none_identity=True, key_id='type', extra_kwargs=None):
factory = _get_factory(factories, value, key_id)
if extra_kwargs is None:
extra_kwargs = dict()
result = factory(*args, **extra_kwargs)
if result is None and none_identity:
result = nn.Identity()
return result
_norms_1d = {
'none': lambda d, device=None: None,
'batch': lambda d, **kwargs: nn.BatchNorm1d(d, **kwargs),
'layer': lambda d, **kwargs: LayerNorm(d, **kwargs)
}
def norm_1d(norm, d, device=None, none_identity=True):
return _build_module(_norms_1d, norm, d, none_identity=none_identity, extra_kwargs={'device': device})
ARGS = {
'norm': 'layer',
'd': 4,
'device': None,
'none_identity': 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 LayerNorm — a LayerNorm output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LayerNorm 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
|
| norm_2d |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("dd38f94f790d5f55") 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 LayerNorm. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
import functools
class LayerNorm(nn.LayerNorm):
def __init__(self, dim, eps=0.001, device=None):
super().__init__((dim,), eps, device=device)
def forward(self, x):
if x.ndim == 4:
u = x.mean(1, keepdim=True)
xmu = x - u
s = xmu.square().mean(1, keepdim=True)
x = xmu / torch.sqrt(s + self.eps)
out = self.weight[:, None, None] * x + self.bias[:, None, None]
else:
out = super().forward(x)
return out
def _build_module(factories, value, *args, none_identity=True, key_id='type', extra_kwargs=None):
factory = _get_factory(factories, value, key_id)
if extra_kwargs is None:
extra_kwargs = dict()
result = factory(*args, **extra_kwargs)
if result is None and none_identity:
result = nn.Identity()
return result
def _get_factory(factories, value, key_id='type'):
if isinstance(value, str):
key = value
kwargs = {}
elif isinstance(value, dict):
kwargs = dict(value)
key = kwargs.pop(key_id)
else:
raise ValueError(type(value))
return functools.partial(factories[key], **kwargs)
_norms_2d = {'none': lambda d, device=None: None, 'batch': lambda d, **kwargs: nn.BatchNorm2d(d, **kwargs), 'layer': lambda d, **kwargs: LayerNorm(d, **kwargs)}
def device(mod):
""" Get the device of a module. """
return next(mod.parameters()).device
def norm_2d(norm, d, device=None, none_identity=True):
return _build_module(_norms_2d, norm, d, none_identity=none_identity, extra_kwargs={'device': device})
torch.manual_seed(0)
ARGS = {
'norm': 'layer',
'd': 8,
'device': None,
'none_identity': 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 LayerNorm — a LayerNorm output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LayerNorm 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
|
| off_diagonal |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("cbcbe66ba5258fb1") 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 1, dtype family float, shape (12,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small square matrix tensor
x = torch.randn(4, 4)
# Define ARGS dict with all parameters
ARGS = {
"x": x,
"keepdim": 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 Tensor, ndim 1, dtype family float, shape (12,) — shape (12,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| parse_dims |
Ran ran, honoured the contract we drafted |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("dfc0d2b811d785ae") 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
def parse_dims(dims):
if isinstance(dims, str):
dims = tuple((int(d) for d in dims.split('-')))
elif isinstance(dims, int):
dims = (dims,)
return dims
# Test with different input types
ARGS = {
"dims": "4-8-16"
}
- 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
|
| sample_bernoulli |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("ab04fff3a9720e27") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# The function sample_bernoulli takes a single parameter 'probs'
# which should be a tensor of probabilities (values between 0 and 1)
# that will be passed to torch.bernoulli()
# Create a small tensor of probabilities with shape (2, 4)
probs = torch.rand(2, 4)
ARGS = {
"probs": probs
}
- 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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| sample_categorical |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("a8117d72551969e1") 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 1, dtype family int, shape (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 torch
torch.manual_seed(0)
# probs should be a tensor with shape (*batch_shape, out_dim)
# The function reshapes it to (-1, out_dim) and uses torch.multinomial
# torch.multinomial requires probabilities to sum to 1 along the last dimension
# Let's create a simple case: batch_shape = (2,), out_dim = 4
probs = torch.tensor([
[0.1, 0.2, 0.3, 0.4],
[0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)
# Verify probs sum to 1 along last dimension
assert torch.allclose(probs.sum(dim=-1), torch.tensor([1.0, 1.0]))
ARGS = {
"probs": probs
}
- 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 1, dtype family int, shape (2,) — shape (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
|
| symexp |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("0d83ad2de737d8cb") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# The function symexp takes a tensor x and applies:
# x.sign() * (x.abs().exp() - 1)
# This requires x to be a tensor with .sign(), .abs(), .exp() methods
x = torch.randn(2, 4)
ARGS = {
"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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| symlog |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("d89a7360f2557af3") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# The function symlog takes a tensor x and applies a symmetric log transform
# It uses: x.sign(), x.abs(), and .log() methods
# So x must be a torch.Tensor
x = torch.randn(2, 4)
ARGS = {
"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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| two_hot |
Ran ran; our contract draft was wrong, not the code |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("420038ff485d6c0b") 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 Tensor, ndim 2, dtype family float, shape (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
torch.manual_seed(0)
# Create bins using the bins function
test_bins = torch.linspace(0, 10, 5)
test_bins = torch.round(test_bins, decimals=4)
# Create a small tensor to encode
# Shape: (2, 1) - batch size 2, single value per sample
tensor = torch.tensor([[2.5], [7.3]], dtype=torch.float32)
ARGS = {
"tensor": tensor,
"bins": test_bins,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 5) — shape (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: none by the harness; any seed is in the setup block
|
| unsqueeze_as |
Ran ran, violated the contract we drafted |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("2b187ef6125cd1bc") 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 (2, 4, 1, 1) 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)
# Create a tensor with shape (2, 4) - 2D tensor
tensor = torch.randn(2, 4)
# Create a target tensor with shape (2, 4, 3, 5) - 4D tensor
# The first 2 dimensions should match the input tensor's shape
target_tensor = torch.randn(2, 4, 3, 5)
ARGS = {
"tensor": tensor,
"target_tensor": target_tensor
}
- 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 4, dtype family float, shape (2, 4, 1, 1) — shape (2, 4, 1, 1) 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
|
| variance_covariance_loss |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("d8c67c4a6ad91b62") 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
torch.manual_seed(0)
# Create a small tensor with shape (batch_size=2, embedding_dim=4)
z = torch.randn(2, 4)
ARGS = {
"z": z,
"contrastive": False,
"eps": 0.0001,
}
- 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
|
| ScalarMLP |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("c15ab938fe840d9f") How it ran |
| WorldModel |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("71323f43911a356d") How it ran |
| _build_module |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("45bed2d814f991f3") How it ran |
| _norm_init_ |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("8bcb44beb386f1ab") How it ran |
| normal_init_ |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("4216a828ef7176fb") How it ran |
| space_flatten |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("148a74da6f2f20e6") How it ran |
| truncated_normal_init_ |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("100163aa698b77ce") How it ran |
| zero_init_ |
Not yet run unverified (harvested, no recorded run) |
jrobine/sgf/src/wm.py code served (permissive licence) · get_code("425012f1ad329944") How it ran |