| AdaInsNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("4d2e3dfcf5e514df") 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, AdaInsNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import math
from einops.layers.torch import Rearrange
torch.manual_seed(0)
# Define the classes from the function signature
class SinusoidalPosEmb(nn.Module):
def __init__(self, num_steps: int, dim: int, rescale_steps: int=4000):
super().__init__()
self.dim = dim
self.num_steps = float(num_steps)
self.rescale_steps = float(rescale_steps)
def forward(self, x):
x = x / self.num_steps * self.rescale_steps
device = x.device
half_dim = self.dim // 2
emb = math.log(10000) / (half_dim - 1)
emb = torch.exp(torch.arange(half_dim, device=device) * -emb)
emb = x[:, None] * emb[None, :]
emb = torch.cat((emb.sin(), emb.cos()), dim=-1)
return emb
class _AdaNorm(nn.Module):
def __init__(self, n_embd: int, max_timestep: int, emb_type: str='adalayernorm_abs'):
super().__init__()
if 'abs' in emb_type:
self.emb = SinusoidalPosEmb(max_timestep, n_embd)
elif 'mlp' in emb_type:
self.emb = nn.Sequential(Rearrange('b -> b 1'), nn.Linear(1, n_embd // 2), nn.ReLU(), nn.Linear(n_embd // 2, n_embd))
else:
self.emb = nn.Embedding(max_timestep, n_embd)
self.silu = nn.SiLU()
self.linear = nn.Linear(n_embd, n_embd * 2)
class AdaInsNorm(_AdaNorm):
def __init__(self, n_embd: int, max_timestep: int, emb_type: str='adalayernorm_abs'):
super().__init__(n_embd, max_timestep, emb_type)
self.instancenorm = nn.InstanceNorm1d(n_embd)
def forward(self, x, timestep):
emb = self.linear(self.silu(self.emb(timestep))).unsqueeze(1)
scale, shift = torch.chunk(emb, 2, dim=2)
x = self.instancenorm(x.transpose(-1, -2)).transpose(-1, -2) * (1 + scale) + shift
return x
# Setup arguments
n_embd = 4
max_timestep = 16
emb_type = 'adalayernorm_abs'
ARGS = {
'n_embd': n_embd,
'max_timestep': max_timestep,
'emb_type': emb_type
}
- 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 AdaInsNorm — 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 AdaInsNorm 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
|
| AdaLayerNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("d61620216d1e0e43") 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, AdaLayerNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import math
from einops.layers.torch import Rearrange
torch.manual_seed(0)
class SinusoidalPosEmb(nn.Module):
def __init__(self, num_steps: int, dim: int, rescale_steps: int=4000):
super().__init__()
self.dim = dim
self.num_steps = float(num_steps)
self.rescale_steps = float(rescale_steps)
def forward(self, x):
x = x / self.num_steps * self.rescale_steps
device = x.device
half_dim = self.dim // 2
emb = math.log(10000) / (half_dim - 1)
emb = torch.exp(torch.arange(half_dim, device=device) * -emb)
emb = x[:, None] * emb[None, :]
emb = torch.cat((emb.sin(), emb.cos()), dim=-1)
return emb
class _AdaNorm(nn.Module):
def __init__(self, n_embd: int, max_timestep: int, emb_type: str='adalayernorm_abs'):
super().__init__()
if 'abs' in emb_type:
self.emb = SinusoidalPosEmb(max_timestep, n_embd)
elif 'mlp' in emb_type:
self.emb = nn.Sequential(Rearrange('b -> b 1'), nn.Linear(1, n_embd // 2), nn.ReLU(), nn.Linear(n_embd // 2, n_embd))
else:
self.emb = nn.Embedding(max_timestep, n_embd)
self.silu = nn.SiLU()
self.linear = nn.Linear(n_embd, n_embd * 2)
class AdaLayerNorm(_AdaNorm):
def __init__(self, n_embd: int, max_timestep: int, emb_type: str='adalayernorm_abs'):
super().__init__(n_embd, max_timestep, emb_type)
self.layernorm = nn.LayerNorm(n_embd, elementwise_affine=False)
def forward(self, x, timestep):
emb = self.linear(self.silu(self.emb(timestep))).unsqueeze(1)
scale, shift = torch.chunk(emb, 2, dim=2)
x = self.layernorm(x) * (1 + scale) + shift
return x
ARGS = {
'n_embd': 4,
'max_timestep': 10,
'emb_type': 'adalayernorm_abs'
}
- 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 AdaLayerNorm — 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 AdaLayerNorm 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
|
| Block |
Ran ran on a synthesized input · constructed an object; no result was computed |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("33602d665cafbd1a") 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, Block: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Dict, List, Optional, Tuple, Union
import math
from typing import Callable, Optional, Union
from einops.layers.torch import Rearrange
from torch import Tensor
torch.manual_seed(0)
# Define the helper classes and functions needed
class SinusoidalPosEmb(nn.Module):
def __init__(self, num_steps: int, dim: int, rescale_steps: int=4000):
super().__init__()
self.dim = dim
self.num_steps = float(num_steps)
self.rescale_steps = float(rescale_steps)
def forward(self, x: Tensor):
x = x / self.num_steps * self.rescale_steps
device = x.device
half_dim = self.dim // 2
emb = math.log(10000) / (half_dim - 1)
emb = torch.exp(torch.arange(half_dim, device=device) * -emb)
emb = x[:, None] * emb[None, :]
emb = torch.cat((emb.sin(), emb.cos()), dim=-1)
return emb
class _AdaNorm(nn.Module):
def __init__(self, n_embd: int, max_timestep: int, emb_type: str='adalayernorm_abs'):
super().__init__()
if 'abs' in emb_type:
self.emb = SinusoidalPosEmb(max_timestep, n_embd)
elif 'mlp' in emb_type:
self.emb = nn.Sequential(Rearrange('b -> b 1'), nn.Linear(1, n_embd // 2), nn.ReLU(), nn.Linear(n_embd // 2, n_embd))
else:
self.emb = nn.Embedding(max_timestep, n_embd)
self.silu = nn.SiLU()
self.linear = nn.Linear(n_embd, n_embd * 2)
def _gelu2(x):
return x * F.sigmoid(1.702 * x)
def _get_activation_fn(activation):
if activation == 'relu':
return F.relu
elif activation == 'gelu':
return F.gelu
elif activation == 'gelu2':
return _gelu2
else:
raise RuntimeError('activation should be relu/gelu/gelu2, not {}'.format(activation))
class AdaInsNorm(_AdaNorm):
def __init__(self, n_embd: int, max_timestep: int, emb_type: str='adalayernorm_abs'):
super().__init__(n_embd, max_timestep, emb_type)
self.instancenorm = nn.InstanceNorm1d(n_embd)
def forward(self, x, timestep):
emb = self.linear(self.silu(self.emb(timestep))).unsqueeze(1)
scale, shift = torch.chunk(emb, 2, dim=2)
x = self.instancenorm(x.transpose(-1, -2)).transpose(-1, -2) * (1 + scale) + shift
return x
class AdaLayerNorm(_AdaNorm):
def __init__(self, n_embd: int, max_timestep: int, emb_type: str='adalayernorm_abs'):
super().__init__(n_embd, max_timestep, emb_type)
self.layernorm = nn.LayerNorm(n_embd, elementwise_affine=False)
def forward(self, x: Tensor, timestep: int):
emb = self.linear(self.silu(self.emb(timestep))).unsqueeze(1)
scale, shift = torch.chunk(emb, 2, dim=2)
x = self.layernorm(x) * (1 + scale) + shift
return x
# Create arguments for Block initialization
ARGS = {
'd_model': 8,
'nhead': 2,
'dim_feedforward': 16,
'dropout': 0.1,
'activation': F.relu,
'batch_first': True,
'norm_first': True,
'device': None,
'dtype': None,
'diffusion_step': 100,
'timestep_type': 'adalayernorm_abs'
}
- 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 Block — 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 Block 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
|
| SinusoidalPosEmb |
Ran ran on a synthesized input · constructed an object; no result was computed |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("1f73949b4bda3c10") 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, SinusoidalPosEmb: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import math
from torch import Tensor
torch.manual_seed(0)
# The function is SinusoidalPosEmb's __init__ and forward methods
# We need to construct valid arguments for the class
# Looking at __init__:
# - num_steps: int
# - dim: int
# - rescale_steps: int (optional, default=4000)
# Looking at forward:
# - x: Tensor - should be 1D or 2D tensor of step indices
# The code does x[:, None] so x must be at least 1D
# It's indexed as x / self.num_steps, so it contains numeric values
# Create a small tensor for x - shape [2] for batch size 2
x = torch.tensor([0.0, 1.0])
ARGS = {
"num_steps": 10,
"dim": 4,
"rescale_steps": 4000
}
- 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 SinusoidalPosEmb — 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 SinusoidalPosEmb 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
|
| _AdaNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("513ddb55864178fe") 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, _AdaNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import math
from einops.layers.torch import Rearrange
torch.manual_seed(0)
ARGS = {
'n_embd': 8,
'max_timestep': 16,
'emb_type': 'adalayernorm_abs'
}
- 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 _AdaNorm — 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 _AdaNorm 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
|
| _gelu2 |
Ran ran; our contract draft was wrong, not the code |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("ce23ad2f08007447") 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)
# Create a small tensor input
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
|
| _get_activation_fn |
Ran ran; our contract draft was wrong, not the code |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("1f6ff9fa607114db") 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 builtin_function_or_method. 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.functional as F
torch.manual_seed(0)
def _gelu2(x):
return x * F.sigmoid(1.702 * x)
def _get_activation_fn(activation):
if activation == 'relu':
return F.relu
elif activation == 'gelu':
return F.gelu
elif activation == 'gelu2':
return _gelu2
else:
raise RuntimeError('activation should be relu/gelu/gelu2, not {}'.format(activation))
ARGS = {
'activation': 'gelu'
}
- 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 builtin_function_or_method — a builtin_function_or_method output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a builtin_function_or_method 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
|
| color_extend |
Ran ran, honoured the contract we drafted |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("ae472f22d0f7c642") 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 2, 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 numpy as np
# The function color_extend takes a single parameter: n_color (an integer)
# It generates a palette of n_color colors by interpolating between 5 base colors
ARGS = {
"n_color": 10
}
- 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 tuple, ndim 2, 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
|
| convert_layout_to_image |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("9ab277ea712083c7") 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 Image. 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
from PIL import Image
torch.manual_seed(0)
# Create small test tensors
# boxes: FloatTensor of shape (num_boxes, 4) with xywh format
boxes = torch.tensor([
[0.3, 0.4, 0.2, 0.3], # xc, yc, w, h
[0.7, 0.6, 0.15, 0.25]
], dtype=torch.float32)
# labels: LongTensor of shape (num_boxes,) with class indices
labels = torch.tensor([0, 1], dtype=torch.long)
# colors: List of RGB tuples, one per class
colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
# canvas_size: tuple of (height, width)
canvas_size = (60, 40)
# resources: optional dict with background image and cropped patches
# Create small PIL images for resources
img_bg = Image.new('RGB', (40, 60), color=(200, 200, 200))
patch1 = Image.new('RGB', (10, 15), color=(255, 100, 100))
patch2 = Image.new('RGB', (8, 12), color=(100, 255, 100))
resources = {
'img_bg': img_bg,
'cropped_patches': [patch1, patch2]
}
# names: optional tuple of class names
names = ('class_a', 'class_b', 'class_c')
# index: boolean flag
index = False
ARGS = {
'boxes': boxes,
'labels': labels,
'colors': colors,
'canvas_size': canvas_size,
'resources': resources,
'names': names,
'index': index
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
|
| convert_xywh_to_ltrb |
Ran ran, violated the contract we drafted |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("d95d45ece970cfa1") 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 numpy as np
torch.manual_seed(0)
# The function takes a bbox parameter which should be unpacked into 4 components (xc, yc, w, h)
# It accepts either np.ndarray or FloatTensor
# Create a numpy array bbox in xywh format
bbox_np = np.array([10.0, 20.0, 4.0, 6.0])
ARGS = {
"bbox": bbox_np
}
- 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 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
|
| save_image |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("c1795e572a421c31") 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 (64, 86, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from PIL import Image
import pathlib
torch.manual_seed(0)
# Create tiny tensors
batch_size = 2
max_objects = 4
num_classes = 6
# batch_boxes: (batch_size, max_objects, 4) in xywh format, normalized to [0, 1]
batch_boxes = torch.rand(batch_size, max_objects, 4) * 0.5 + 0.2
batch_boxes[:, :, 2:] = torch.rand(batch_size, max_objects, 2) * 0.3 + 0.1 # w, h smaller
# batch_labels: (batch_size, max_objects) with class indices
batch_labels = torch.randint(0, num_classes, (batch_size, max_objects))
# batch_mask: (batch_size, max_objects) boolean mask to filter valid objects
batch_mask = torch.ones(batch_size, max_objects, dtype=torch.bool)
batch_mask[0, 2:] = False # First sample has only 2 valid objects
batch_mask[1, 3] = False # Second sample has 3 valid objects
# out_path: None (will return image instead of saving)
out_path = None
# canvas_size: (height, width)
canvas_size = (60, 40)
# nrow: number of images per row in grid
nrow = 2
# batch_resources: None (no cropped patches)
batch_resources = None
# use_grid: return grid image
use_grid = True
# draw_label: don't draw labels
draw_label = False
# draw_index: don't draw indices
draw_index = False
# dataset: choose from ['rico13', 'rico25', 'publaynet', 'magazine', 'crello']
dataset = 'publaynet'
ARGS = {
'batch_boxes': batch_boxes,
'batch_labels': batch_labels,
'batch_mask': batch_mask,
'out_path': out_path,
'canvas_size': canvas_size,
'nrow': nrow,
'batch_resources': batch_resources,
'use_grid': use_grid,
'draw_label': draw_label,
'draw_index': draw_index,
'dataset': dataset,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL, einops, numpy, torch, torchvision — 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 (64, 86, 3) — shape (64, 86, 3) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| torch_to_numpy_image |
Ran ran; our contract draft was wrong, not the code |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("a9e89a5d98bea94d") 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, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# Create a small image tensor: (C, H, W) with values in [0.0, 1.0]
# Using distinct sizes: 3 channels, 4 height, 5 width
input_th = torch.rand(3, 4, 5)
ARGS = {
"input_th": input_th
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, 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 3, dtype family int, shape (4, 5, 3) — shape (4, 5, 3) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| Diffusion |
Not yet run unverified (harvested, no recorded run) |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("efd5ffb686bfb773") How it ran |
| TransformerEncoder |
Not yet run unverified (harvested, no recorded run) |
puar-playground/lace/model_diffusion.py code served (permissive licence) · get_code("6331fa2f5c6d4fbe") How it ran |