| AdaLN |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("1999017e042f05f2") 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 3, dtype family float, shape (2, 6, 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
class AdaLN(nn.Module):
def __init__(self, dim, ada_mode='ada', r=None, alpha=None):
super().__init__()
self.ada_mode = ada_mode
self.scale_shift_table = None
if ada_mode == 'ada':
self.time_ada = nn.Linear(dim, 6 * dim, bias=True)
elif ada_mode == 'ada_single':
self.scale_shift_table = nn.Parameter(torch.zeros(6, dim))
elif ada_mode in ['ada_sola', 'ada_sola_bias']:
self.lora_a = nn.Linear(dim, r * 6, bias=False)
self.lora_b = nn.Linear(r * 6, dim * 6, bias=False)
self.scaling = alpha / r
if ada_mode == 'ada_sola_bias':
self.scale_shift_table = nn.Parameter(torch.zeros(6, dim))
else:
raise NotImplementedError
def forward(self, time_token=None, time_ada=None):
if self.ada_mode == 'ada':
assert time_ada is None
B = time_token.shape[0]
time_ada = self.time_ada(time_token).reshape(B, 6, -1)
elif self.ada_mode == 'ada_single':
B = time_ada.shape[0]
time_ada = time_ada.reshape(B, 6, -1)
time_ada = self.scale_shift_table[None] + time_ada
elif self.ada_mode in ['ada_sola', 'ada_sola_bias']:
B = time_ada.shape[0]
time_ada_lora = self.lora_b(self.lora_a(time_token)) * self.scaling
time_ada = time_ada + time_ada_lora
time_ada = time_ada.reshape(B, 6, -1)
if self.scale_shift_table is not None:
time_ada = self.scale_shift_table[None] + time_ada
else:
raise NotImplementedError
return time_ada
INIT_ARGS = {
'dim': 4,
'ada_mode': 'ada',
'r': None,
'alpha': None,
}
ARGS = {
'time_token': torch.randn(2, 4),
'time_ada': None,
}
if __name__ == '__main__':
model = AdaLN(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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 3, dtype family float, shape (2, 6, 4) — shape (2, 6, 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)
|
| ApproximateGELU |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("855ca3a1a7d22ee5") 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, 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 torch.nn as nn
class ApproximateGELU(nn.Module):
def __init__(self, dim_in: int, dim_out: int, bias: bool=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out, bias=bias)
def forward(self, x: torch.Tensor) -> torch.Tensor:
x = self.proj(x)
return x * torch.sigmoid(1.702 * x)
INIT_ARGS = {
'dim_in': 4,
'dim_out': 3,
'bias': True,
}
ARGS = {
'x': torch.randn(2, 4),
}
if __name__ == '__main__':
model = ApproximateGELU(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| FeedForward |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("e85a8130cccd0e41") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
class ApproximateGELU(nn.Module):
def __init__(self, dim_in: int, dim_out: int, bias: bool=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out, bias=bias)
def forward(self, x: torch.Tensor) -> torch.Tensor:
x = self.proj(x)
return x * torch.sigmoid(1.702 * x)
class GEGLU(nn.Module):
def __init__(self, dim_in: int, dim_out: int, bias: bool=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out * 2, bias=bias)
def gelu(self, gate: torch.Tensor) -> torch.Tensor:
if gate.device.type != 'mps':
return F.gelu(gate)
return F.gelu(gate.to(dtype=torch.float32)).to(dtype=gate.dtype)
def forward(self, hidden_states):
hidden_states = self.proj(hidden_states)
hidden_states, gate = hidden_states.chunk(2, dim=-1)
return hidden_states * self.gelu(gate)
class GELU(nn.Module):
def __init__(self, dim_in: int, dim_out: int, approximate: str='none', bias: bool=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out, bias=bias)
self.approximate = approximate
def gelu(self, gate: torch.Tensor) -> torch.Tensor:
if gate.device.type != 'mps':
return F.gelu(gate, approximate=self.approximate)
return F.gelu(gate.to(dtype=torch.float32), approximate=self.approximate).to(dtype=gate.dtype)
def forward(self, hidden_states):
hidden_states = self.proj(hidden_states)
hidden_states = self.gelu(hidden_states)
return hidden_states
class GESnake(nn.Module):
def __init__(self, dim_in, dim_out, bias, alpha_trainable=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out * 2, bias=bias)
self.alpha = nn.Parameter(torch.ones(1, 1, dim_out))
self.beta = nn.Parameter(torch.ones(1, 1, dim_out))
self.alpha.requires_grad = alpha_trainable
self.beta.requires_grad = alpha_trainable
def forward(self, x):
x = self.proj(x)
x, gate = x.chunk(2, dim=-1)
return x * snake_beta(gate, self.alpha, self.beta)
class Snake(nn.Module):
def __init__(self, dim_in, dim_out, bias, alpha_trainable=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out, bias=bias)
self.alpha = nn.Parameter(torch.ones(1, 1, dim_out))
self.beta = nn.Parameter(torch.ones(1, 1, dim_out))
self.alpha.requires_grad = alpha_trainable
self.beta.requires_grad = alpha_trainable
def forward(self, x):
x = self.proj(x)
x = snake_beta(x, self.alpha, self.beta)
return x
def snake_beta(x, alpha, beta):
return x + beta * torch.sin(x * alpha).pow(2)
class FeedForward(nn.Module):
def __init__(self, dim, dim_out=None, mult=4, dropout=0.0, activation_fn='geglu', final_dropout=False, inner_dim=None, bias=True):
super().__init__()
if inner_dim is None:
inner_dim = int(dim * mult)
dim_out = dim_out if dim_out is not None else dim
if activation_fn == 'gelu':
act_fn = GELU(dim, inner_dim, bias=bias)
elif activation_fn == 'gelu-approximate':
act_fn = GELU(dim, inner_dim, approximate='tanh', bias=bias)
elif activation_fn == 'geglu':
act_fn = GEGLU(dim, inner_dim, bias=bias)
elif activation_fn == 'geglu-approximate':
act_fn = ApproximateGELU(dim, inner_dim, bias=bias)
elif activation_fn == 'snake':
act_fn = Snake(dim, inner_dim, bias=bias)
elif activation_fn == 'gesnake':
act_fn = GESnake(dim, inner_dim, bias=bias)
else:
raise NotImplementedError
self.net = nn.ModuleList([])
self.net.append(act_fn)
self.net.append(nn.Dropout(dropout))
self.net.append(nn.Linear(inner_dim, dim_out, bias=bias))
if final_dropout:
self.net.append(nn.Dropout(dropout))
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
for module in self.net:
hidden_states = module(hidden_states)
return hidden_states
INIT_ARGS = {
'dim': 4,
'dim_out': 3,
'mult': 4,
'dropout': 0.1,
'activation_fn': 'geglu',
'final_dropout': False,
'inner_dim': None,
'bias': True,
}
ARGS = {
'hidden_states': torch.randn(2, 4),
}
if __name__ == '__main__':
model = FeedForward(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected shape: (2, 3)")
- 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)
|
| GEGLU |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("26b300e620311af5") 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, 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 torch.nn as nn
import torch.nn.functional as F
class GEGLU(nn.Module):
def __init__(self, dim_in: int, dim_out: int, bias: bool=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out * 2, bias=bias)
def gelu(self, gate: torch.Tensor) -> torch.Tensor:
if gate.device.type != 'mps':
return F.gelu(gate)
return F.gelu(gate.to(dtype=torch.float32)).to(dtype=gate.dtype)
def forward(self, hidden_states):
hidden_states = self.proj(hidden_states)
hidden_states, gate = hidden_states.chunk(2, dim=-1)
return hidden_states * self.gelu(gate)
INIT_ARGS = {
'dim_in': 4,
'dim_out': 3,
'bias': True,
}
ARGS = {
'hidden_states': torch.randn(2, 4),
}
if __name__ == '__main__':
model = GEGLU(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| GELU |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("a4664f5e974677e5") 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, 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 torch.nn as nn
import torch.nn.functional as F
class GELU(nn.Module):
def __init__(self, dim_in: int, dim_out: int, approximate: str='none', bias: bool=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out, bias=bias)
self.approximate = approximate
def gelu(self, gate: torch.Tensor) -> torch.Tensor:
if gate.device.type != 'mps':
return F.gelu(gate, approximate=self.approximate)
return F.gelu(gate.to(dtype=torch.float32), approximate=self.approximate).to(dtype=gate.dtype)
def forward(self, hidden_states):
hidden_states = self.proj(hidden_states)
hidden_states = self.gelu(hidden_states)
return hidden_states
INIT_ARGS = {
'dim_in': 4,
'dim_out': 3,
'approximate': 'none',
'bias': True
}
ARGS = {
'hidden_states': torch.randn(2, 4)
}
if __name__ == '__main__':
model = GELU(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| GESnake |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("f88c5e27a48552c9") 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 3, dtype family float, shape (1, 2, 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 torch.nn as nn
def snake_beta(x, alpha, beta):
return x + beta * torch.sin(x * alpha).pow(2)
class GESnake(nn.Module):
def __init__(self, dim_in, dim_out, bias, alpha_trainable=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out * 2, bias=bias)
self.alpha = nn.Parameter(torch.ones(1, 1, dim_out))
self.beta = nn.Parameter(torch.ones(1, 1, dim_out))
self.alpha.requires_grad = alpha_trainable
self.beta.requires_grad = alpha_trainable
def forward(self, x):
x = self.proj(x)
x, gate = x.chunk(2, dim=-1)
return x * snake_beta(gate, self.alpha, self.beta)
INIT_ARGS = {
'dim_in': 4,
'dim_out': 3,
'bias': True,
'alpha_trainable': True,
}
ARGS = {
'x': torch.randn(2, 4),
}
if __name__ == '__main__':
model = GESnake(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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 3, dtype family float, shape (1, 2, 3) — shape (1, 2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| PE_wrapper |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("f9bb66c0ba81da7e") 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 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import warnings
class PositionalConvEmbedding(nn.Module):
"""
Relative positional embedding used in HuBERT
"""
def __init__(self, dim=768, kernel_size=128, groups=16):
super().__init__()
self.conv = nn.Conv1d(dim, dim, kernel_size=kernel_size, padding=kernel_size // 2, groups=groups, bias=True)
self.conv = nn.utils.parametrizations.weight_norm(self.conv, name='weight', dim=2)
def forward(self, x):
x = self.conv(x)
x = F.gelu(x[:, :, :-1])
return x
class SinusoidalPositionalEncoding(nn.Module):
def __init__(self, dim, length):
super(SinusoidalPositionalEncoding, self).__init__()
self.length = length
self.dim = dim
self.register_buffer('pe', self._generate_positional_encoding(length, dim))
def _generate_positional_encoding(self, length, dim):
pe = torch.zeros(length, dim)
position = torch.arange(0, length, dtype=torch.float).unsqueeze(1)
div_term = torch.exp(torch.arange(0, dim, 2).float() * (-math.log(10000.0) / dim))
pe[:, 0::2] = torch.sin(position * div_term)
pe[:, 1::2] = torch.cos(position * div_term)
pe = pe.unsqueeze(0)
return pe
def forward(self, x):
x = x + self.pe[:, :x.size(1)]
return x
def _no_grad_trunc_normal_(tensor, mean, std, a, b):
def norm_cdf(x):
return (1.0 + math.erf(x / math.sqrt(2.0))) / 2.0
if mean < a - 2 * std or mean > b + 2 * std:
warnings.warn('mean is more than 2 std from [a, b] in nn.init.trunc_normal_. The distribution of values may be incorrect.', stacklevel=2)
with torch.no_grad():
l = norm_cdf((a - mean) / std)
u = norm_cdf((b - mean) / std)
tensor.uniform_(2 * l - 1, 2 * u - 1)
tensor.erfinv_()
tensor.mul_(std * math.sqrt(2.0))
tensor.add_(mean)
tensor.clamp_(min=a, max=b)
return tensor
def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0):
"""Fills the input Tensor with values drawn from a truncated
normal distribution. The values are effectively drawn from the
normal distribution :math:`\\mathcal{N}(\\text{mean}, \\text{std}^2)`
with values outside :math:`[a, b]` redrawn until they are within
the bounds. The method used for generating the random values works
best when :math:`a \\leq \\text{mean} \\leq b`.
Args:
tensor: an n-dimensional `torch.Tensor`
mean: the mean of the normal distribution
std: the standard deviation of the normal distribution
a: the minimum cutoff value
b: the maximum cutoff value
Examples:
>>> w = torch.empty(3, 5)
>>> nn.init.trunc_normal_(w)
"""
return _no_grad_trunc_normal_(tensor, mean, std, a, b)
class PE_wrapper(nn.Module):
def __init__(self, dim=768, method='abs', length=None, **kwargs):
super().__init__()
self.method = method
if method == 'abs':
self.length = length
self.abs_pe = nn.Parameter(torch.zeros(1, length, dim))
trunc_normal_(self.abs_pe, std=0.02)
elif method == 'conv':
self.conv_pe = PositionalConvEmbedding(dim=dim, **kwargs)
elif method == 'sinu':
self.sinu_pe = SinusoidalPositionalEncoding(dim=dim, length=length)
elif method == 'none':
self.id = nn.Identity()
else:
raise NotImplementedError
def forward(self, x):
if self.method == 'abs':
_, L, _ = x.shape
assert L <= self.length
x = x + self.abs_pe[:, :L, :]
elif self.method == 'conv':
x = x + self.conv_pe(x)
elif self.method == 'sinu':
x = self.sinu_pe(x)
elif self.method == 'none':
x = self.id(x)
else:
raise NotImplementedError
return x
INIT_ARGS = {
'dim': 4,
'method': 'abs',
'length': 8,
}
ARGS = {
'x': torch.randn(2, 6, 4),
}
if __name__ == '__main__':
model = PE_wrapper(**INIT_ARGS)
output = model(**ARGS)
print("Output shape:", output.shape)
print("Output:", 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 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| PatchEmbed |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("9f2cdbcb2103e1b1") 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 3, dtype family float, shape (2, 4, 64) 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 PatchEmbed(nn.Module):
"""
Image to Patch Embedding
"""
def __init__(self, patch_size, in_chans=3, embed_dim=768, input_type='2d'):
super().__init__()
self.patch_size = patch_size
self.input_type = input_type
if input_type == '2d':
self.proj = nn.Conv2d(in_chans, embed_dim, kernel_size=patch_size, stride=patch_size, bias=True)
elif input_type == '1d':
self.proj = nn.Conv1d(in_chans, embed_dim, kernel_size=patch_size, stride=patch_size, bias=True)
def forward(self, x):
if self.input_type == '2d':
B, C, H, W = x.shape
assert H % self.patch_size == 0 and W % self.patch_size == 0
elif self.input_type == '1d':
B, C, H = x.shape
assert H % self.patch_size == 0
x = self.proj(x).flatten(2).transpose(1, 2)
return x
INIT_ARGS = {
'patch_size': 4,
'in_chans': 3,
'embed_dim': 64,
'input_type': '2d'
}
ARGS = {
'x': torch.randn(2, 3, 8, 8)
}
if __name__ == '__main__':
model = PatchEmbed(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected shape: (2, 4, 64)")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 4, 64) — shape (2, 4, 64) 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)
|
| PositionalConvEmbedding |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("dd416fb8e3e347c7") 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 3, dtype family float, shape (2, 4, 16) 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 torch.nn.functional as F
class PositionalConvEmbedding(nn.Module):
"""
Relative positional embedding used in HuBERT
"""
def __init__(self, dim=768, kernel_size=128, groups=16):
super().__init__()
self.conv = nn.Conv1d(dim, dim, kernel_size=kernel_size, padding=kernel_size // 2, groups=groups, bias=True)
self.conv = nn.utils.parametrizations.weight_norm(self.conv, name='weight', dim=2)
def forward(self, x):
x = self.conv(x)
x = F.gelu(x[:, :, :-1])
return x
INIT_ARGS = {
'dim': 4,
'kernel_size': 8,
'groups': 2,
}
ARGS = {
'x': torch.randn(2, 4, 16),
}
if __name__ == '__main__':
model = PositionalConvEmbedding(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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 3, dtype family float, shape (2, 4, 16) — shape (2, 4, 16) 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)
|
| RotaryEmbedding |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("4edb80e5146622da") 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 tuple, ndim 5, 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
INIT_ARGS = {
'dim': 8
}
ARGS = {
'q': torch.randn(2, 4, 3, 8),
'k': torch.randn(2, 4, 3, 8)
}
def rotate_half(x):
x1, x2 = x.chunk(2, dim=-1)
return torch.cat((-x2, x1), dim=-1)
def apply_rotary_pos_emb(x, cos, sin):
cos = cos[:, :, :x.shape[-2], :]
sin = sin[:, :, :x.shape[-2], :]
return x * cos + rotate_half(x) * sin
class RotaryEmbedding(torch.nn.Module):
def __init__(self, dim: int):
super().__init__()
inv_freq = 1.0 / 10000 ** (torch.arange(0, dim, 2).float() / dim)
self.register_buffer('inv_freq', inv_freq)
self._seq_len_cached = None
self._cos_cached = None
self._sin_cached = None
def _update_cos_sin_tables(self, x, seq_dimension=-2):
seq_len = x.shape[seq_dimension]
if seq_len != self._seq_len_cached or self._cos_cached.device != x.device or self._cos_cached.dtype != x.dtype:
self._seq_len_cached = seq_len
t = torch.arange(x.shape[seq_dimension], device=x.device, dtype=torch.float32)
freqs = torch.einsum('i,j->ij', t, self.inv_freq.to(x.dtype))
emb = torch.cat((freqs, freqs), dim=-1).to(x.device)
self._cos_cached = emb.cos()[None, None, :, :].to(x.dtype)
self._sin_cached = emb.sin()[None, None, :, :].to(x.dtype)
return (self._cos_cached, self._sin_cached)
def forward(self, q, k):
self._cos_cached, self._sin_cached = self._update_cos_sin_tables(q.float(), seq_dimension=-2)
if k is not None:
return (apply_rotary_pos_emb(q.float(), self._cos_cached, self._sin_cached).type_as(q), apply_rotary_pos_emb(k.float(), self._cos_cached, self._sin_cached).type_as(k))
else:
return (apply_rotary_pos_emb(q.float(), self._cos_cached, self._sin_cached).type_as(q), None)
if __name__ == '__main__':
model = RotaryEmbedding(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shapes: q={output[0].shape}, k={output[1].shape}")
- 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 tuple, ndim 5, dtype family float — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| SinusoidalPositionalEncoding |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("64b7554453a70d14") 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 3, dtype family float, shape (2, 8, 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
class SinusoidalPositionalEncoding(nn.Module):
def __init__(self, dim, length):
super(SinusoidalPositionalEncoding, self).__init__()
self.length = length
self.dim = dim
self.register_buffer('pe', self._generate_positional_encoding(length, dim))
def _generate_positional_encoding(self, length, dim):
pe = torch.zeros(length, dim)
position = torch.arange(0, length, dtype=torch.float).unsqueeze(1)
div_term = torch.exp(torch.arange(0, dim, 2).float() * (-math.log(10000.0) / dim))
pe[:, 0::2] = torch.sin(position * div_term)
pe[:, 1::2] = torch.cos(position * div_term)
pe = pe.unsqueeze(0)
return pe
def forward(self, x):
x = x + self.pe[:, :x.size(1)]
return x
INIT_ARGS = {
'dim': 4,
'length': 8,
}
ARGS = {
'x': torch.randn(2, 8, 4),
}
if __name__ == '__main__':
model = SinusoidalPositionalEncoding(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
print(f"Output:\n{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 3, dtype family float, shape (2, 8, 4) — shape (2, 8, 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)
|
| Snake |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("1ba59f2c2995a11d") 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 3, dtype family float, shape (1, 2, 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 torch.nn as nn
def snake_beta(x, alpha, beta):
return x + beta * torch.sin(x * alpha).pow(2)
class Snake(nn.Module):
def __init__(self, dim_in, dim_out, bias, alpha_trainable=True):
super().__init__()
self.proj = nn.Linear(dim_in, dim_out, bias=bias)
self.alpha = nn.Parameter(torch.ones(1, 1, dim_out))
self.beta = nn.Parameter(torch.ones(1, 1, dim_out))
self.alpha.requires_grad = alpha_trainable
self.beta.requires_grad = alpha_trainable
def forward(self, x):
x = self.proj(x)
x = snake_beta(x, self.alpha, self.beta)
return x
INIT_ARGS = {
'dim_in': 4,
'dim_out': 3,
'bias': True,
'alpha_trainable': True,
}
ARGS = {
'x': torch.randn(2, 4),
}
if __name__ == '__main__':
snake = Snake(**INIT_ARGS)
output = snake(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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 3, dtype family float, shape (1, 2, 3) — shape (1, 2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| TimestepEmbedder |
Ran ran on a synthesized input |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("ec75a1f98a2e71d6") 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, 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
import torch.nn as nn
import math
def timestep_embedding(timesteps, dim, max_period=10000):
"""
Create sinusoidal timestep embeddings.
:param timesteps: a 1-D Tensor of N indices, one per batch element.
These may be fractional.
:param dim: the dimension of the output.
:param max_period: controls the minimum frequency of the embeddings.
:return: an [N x dim] Tensor of positional embeddings.
"""
half = dim // 2
freqs = torch.exp(-math.log(max_period) * torch.arange(start=0, end=half, dtype=torch.float32) / half).to(device=timesteps.device)
args = timesteps[:, None].float() * freqs[None]
embedding = torch.cat([torch.cos(args), torch.sin(args)], dim=-1)
if dim % 2:
embedding = torch.cat([embedding, torch.zeros_like(embedding[:, :1])], dim=-1)
return embedding
class TimestepEmbedder(nn.Module):
"""
Embeds scalar timesteps into vector representations.
"""
def __init__(self, hidden_size, frequency_embedding_size=256, out_size=None):
super().__init__()
if out_size is None:
out_size = hidden_size
self.mlp = nn.Sequential(nn.Linear(frequency_embedding_size, hidden_size, bias=True), nn.SiLU(), nn.Linear(hidden_size, out_size, bias=True))
self.frequency_embedding_size = frequency_embedding_size
def forward(self, t):
t_freq = timestep_embedding(t, self.frequency_embedding_size).type(self.mlp[0].weight.dtype)
t_emb = self.mlp(t_freq)
return t_emb
INIT_ARGS = {
'hidden_size': 8,
'frequency_embedding_size': 16,
'out_size': 12
}
ARGS = {
't': torch.tensor([0, 1], dtype=torch.long)
}
if __name__ == '__main__':
model = TimestepEmbedder(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {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, 12) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| apply_rotary_pos_emb |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("206c90f5d5d477d1") 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 4, dtype family float, shape (2, 3, 4, 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)
# Create input tensor x with shape (batch=2, heads=3, seq_len=4, head_dim=4)
# The function chunks on dim=-1, so head_dim must be even
x = torch.randn(2, 3, 4, 4)
# Create cos tensor with shape (batch=2, heads=3, max_seq_len=5, head_dim=4)
# The function slices [:, :, :x.shape[-2], :] so we need seq_len dimension > x's seq_len
cos = torch.randn(2, 3, 5, 4)
# Create sin tensor with same shape as cos
sin = torch.randn(2, 3, 5, 4)
ARGS = {
"x": x,
"cos": cos,
"sin": sin,
}
- 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 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 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
|
| compute_mask_indices |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("8b8f03240223d1ab") 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 numpy as np
torch.manual_seed(0)
# Create small tensors for testing
batch_size = 2
timesteps = 4
# Optional padding mask - shape (batch_size, timesteps)
# True values indicate padding, False indicates valid positions
padding_mask = torch.tensor([
[False, False, True, True],
[False, False, False, True]
])
ARGS = {
'shape': (batch_size, timesteps),
'padding_mask': padding_mask,
'mask_prob': 0.5,
'mask_length': 2,
'mask_type': 'static',
'mask_other': 0.1,
'min_masks': 1,
'no_overlap': False,
'min_space': 0
}
- 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 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
|
| create_mask |
Ran ran; our contract draft was wrong, not the code |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("2004128767739013") 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 4, dtype family float, shape (2, 1, 4, 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
from einops import rearrange, repeat
torch.manual_seed(0)
# Analyze the function signature and body:
# - q_shape: tuple used as q_shape[0] (batch), q_shape[-2] (sequence length i)
# - k_shape: tuple used as k_shape[-2] (sequence length j)
# - device: string or torch.device
# - q_mask: optional tensor, defaults to ones((b, i), device=device, dtype=torch.bool)
# - k_mask: optional tensor, defaults to ones((b, j), device=device, dtype=torch.bool)
# Create small tensors with distinct dimensions
batch_size = 2
q_seq_len = 4
k_seq_len = 3
device = 'cpu'
# q_shape should have batch at index 0 and sequence length at index -2
# Common pattern: (batch, heads, seq_len, dim) or (batch, seq_len, dim)
q_shape = (batch_size, 8, q_seq_len, 64) # (batch, heads, seq_len, dim)
k_shape = (batch_size, 8, k_seq_len, 64) # (batch, heads, seq_len, dim)
# Optional masks - can be None to test defaults, or provide explicit ones
q_mask = torch.ones((batch_size, q_seq_len), device=device, dtype=torch.bool)
k_mask = torch.ones((batch_size, k_seq_len), device=device, dtype=torch.bool)
ARGS = {
'q_shape': q_shape,
'k_shape': k_shape,
'device': device,
'q_mask': q_mask,
'k_mask': k_mask,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- einops, 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, 1, 4, 3) — shape (2, 1, 4, 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
|
| film_modulate |
Ran ran, honoured the contract we drafted |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("0e9be0fe6b203878") 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 as nn
torch.manual_seed(0)
# Construct tiny tensors for the function arguments
# film_modulate performs: x * (1 + scale) + shift
# All three parameters are used with arithmetic operations
x = torch.randn(2, 4) # batch size 2, dimension 4
shift = torch.randn(2, 4) # same shape as x
scale = torch.randn(2, 4) # same shape as x
ARGS = {
"x": x,
"shift": shift,
"scale": scale,
}
- 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
|
| snake_beta |
Ran ran; our contract draft was wrong, not the code |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("8f8b4880e8072344") 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)
# Construct arguments for snake_beta function
x = torch.randn(2, 4) # Small tensor: batch size 2, dimension 4
alpha = 0.5 # Scalar parameter for modulation
beta = 0.3 # Scalar parameter for amplitude
ARGS = {
"x": x,
"alpha": alpha,
"beta": beta
}
- 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
|
| Attention |
Not yet run unverified (harvested, no recorded run) |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("531168589467d2a8") How it ran |
| DiTBlock |
Not yet run unverified (harvested, no recorded run) |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("d23e4f9c8defff20") How it ran |
| DiTControlNet |
Not yet run unverified (harvested, no recorded run) |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("7f5058304c41fd44") How it ran |
| DiTControlNetEmbed |
Not yet run unverified (harvested, no recorded run) |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("56037e5ee5cc1c1f") How it ran |
| add_mask |
Not yet run unverified (harvested, no recorded run) |
haidog-yaqub/EzAudio/src/models/controlnet.py code served (permissive licence) · get_code("aefbf29ffedaf4a6") How it ran |