| BasicBlockV1b |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("7e0099013f714d0b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import numpy as np
INIT_ARGS = {
'inplanes': 4,
'planes': 8,
'stride': 1,
'dilation': 2,
'downsample': nn.Sequential(
nn.Conv2d(4, 8, kernel_size=1, stride=1, bias=False),
nn.BatchNorm2d(8)
),
'previous_dilation': 1,
'norm_layer': nn.BatchNorm2d
}
ARGS = {
'x': torch.randn(2, 4, 6, 8)
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- 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 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| BatchImageNormalize |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("339f5051599196e6") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 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
INIT_ARGS = {
'mean': [0.485, 0.456, 0.406, 0.5],
'std': [0.229, 0.224, 0.225, 0.2],
'dtype': torch.float,
}
ARGS = {
'tensor': torch.randn(2, 4, 3, 5),
}
class BatchImageNormalize:
def __init__(self, mean, std, dtype=torch.float):
self.mean = torch.as_tensor(mean, dtype=dtype)[None, :, None, None]
self.std = torch.as_tensor(std, dtype=dtype)[None, :, None, None]
def __call__(self, tensor):
tensor = tensor.clone()
tensor.sub_(self.mean.to(tensor.device)).div_(self.std.to(tensor.device))
return tensor
if __name__ == '__main__':
normalizer = BatchImageNormalize(**INIT_ARGS)
result = normalizer(**ARGS)
print(f"Input shape: {ARGS['tensor'].shape}")
print(f"Output shape: {result.shape}")
print(f"Output sample:\n{result}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| BottleneckV1b |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("d040bbf8b42c1853") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 64, 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
import torch.nn as nn
class BottleneckV1b(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=None, previous_dilation=1, norm_layer=nn.BatchNorm2d):
super(BottleneckV1b, self).__init__()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
self.bn1 = norm_layer(planes)
self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=dilation, dilation=dilation, bias=False)
self.bn2 = norm_layer(planes)
self.conv3 = nn.Conv2d(planes, planes * self.expansion, kernel_size=1, bias=False)
self.bn3 = norm_layer(planes * self.expansion)
self.relu = nn.ReLU(inplace=True)
self.downsample = downsample
self.stride = stride
def forward(self, x):
residual = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out = self.relu(out)
out = self.conv3(out)
out = self.bn3(out)
if self.downsample is not None:
residual = self.downsample(x)
out = out + residual
out = self.relu(out)
return out
# Create a simple downsample module for stride > 1
downsample_module = nn.Sequential(
nn.Conv2d(16, 64, kernel_size=1, stride=2, bias=False),
nn.BatchNorm2d(64)
)
INIT_ARGS = {
'inplanes': 16,
'planes': 16,
'stride': 2,
'dilation': 1,
'downsample': downsample_module,
'previous_dilation': 1,
'norm_layer': nn.BatchNorm2d
}
ARGS = {
'x': torch.randn(2, 16, 8, 8)
}
if __name__ == '__main__':
model = BottleneckV1b(**INIT_ARGS)
model.eval()
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected shape: torch.Size([2, 64, 4, 4])")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 64, 4, 4) — shape (2, 64, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| ConvModule |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("36ecf3e15546035e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 16, 8, 8) 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 ConvModule(nn.Module):
def __init__(self, in_channels=32, out_channels=32, kernel_size=3, stride=1, padding=1):
super().__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding)
self.norm = nn.BatchNorm2d(out_channels)
self.activation = nn.ReLU()
def forward(self, x):
return self.activation(self.norm(self.conv(x)))
INIT_ARGS = {
'in_channels': 3,
'out_channels': 16,
'kernel_size': 3,
'stride': 1,
'padding': 1,
}
ARGS = {
'x': torch.randn(2, 3, 8, 8),
}
if __name__ == '__main__':
module = ConvModule(**INIT_ARGS)
output = module(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected shape: (2, 16, 8, 8)")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 16, 8, 8) — shape (2, 16, 8, 8) 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)
|
| LRMult |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("2028862f40603cc7") 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 NoneType. 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
class LRMult(object):
def __init__(self, lr_mult=1.0):
self.lr_mult = lr_mult
def __call__(self, m):
if getattr(m, 'weight', None) is not None:
m.weight.lr_mult = self.lr_mult
if getattr(m, 'bias', None) is not None:
m.bias.lr_mult = self.lr_mult
INIT_ARGS = {
'lr_mult': 0.1
}
# Create a simple module with weight and bias to pass to __call__
test_module = nn.Linear(4, 3)
ARGS = {
'm': test_module
}
METHOD = '__call__'
# Construct and call
lr_mult_instance = LRMult(**INIT_ARGS)
lr_mult_instance(**ARGS)
- 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 NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| ObjectAttentionBlock2D |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("e0f1a4750642d91b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 8, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
from torch.nn import BatchNorm2d
INIT_ARGS = {
'in_channels': 4,
'key_channels': 8,
'scale': 2,
'norm_layer': BatchNorm2d,
'align_corners': True,
}
ARGS = {
'x': torch.randn(2, 4, 8, 6),
'proxy': torch.randn(2, 4, 4, 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 4, dtype family float, shape (2, 4, 8, 6) — shape (2, 4, 8, 6) 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)
|
| ScaleLayer |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("7c22256846b5a788") 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 numpy as np
# INIT_ARGS for ScaleLayer.__init__(init_value=1.0, lr_mult=1)
INIT_ARGS = {
'init_value': 2.0,
'lr_mult': 0.5
}
# ARGS for ScaleLayer.forward(x)
ARGS = {
'x': torch.randn(2, 4, 3)
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- 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 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)
|
| SpatialGather_Module |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("fc329aee6357b551") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 5, 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
import torch.nn.functional as F
class SpatialGather_Module(nn.Module):
"""
Aggregate the context features according to the initial
predicted probability distribution.
Employ the soft-weighted method to aggregate the context.
"""
def __init__(self, cls_num=0, scale=1):
super(SpatialGather_Module, self).__init__()
self.cls_num = cls_num
self.scale = scale
def forward(self, feats, probs):
batch_size, c, h, w = (probs.size(0), probs.size(1), probs.size(2), probs.size(3))
probs = probs.view(batch_size, c, -1)
feats = feats.view(batch_size, feats.size(1), -1)
feats = feats.permute(0, 2, 1)
probs = F.softmax(self.scale * probs, dim=2)
ocr_context = torch.matmul(probs, feats).permute(0, 2, 1).unsqueeze(3)
return ocr_context
INIT_ARGS = {
'cls_num': 5,
'scale': 2
}
ARGS = {
'feats': torch.randn(2, 4, 3, 3),
'probs': torch.randn(2, 5, 3, 3)
}
if __name__ == '__main__':
module = SpatialGather_Module(**INIT_ARGS)
output = module(**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 4, dtype family float, shape (2, 4, 5, 1) — shape (2, 4, 5, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| SpatialOCR_Module |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("7936d6a591621025") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
# Import the classes
import torch.nn.functional as F
class ObjectAttentionBlock2D(nn.Module):
"""
The basic implementation for object context block
Input:
N X C X H X W
Parameters:
in_channels : the dimension of the input feature map
key_channels : the dimension after the key/query transform
scale : choose the scale to downsample the input feature maps (save memory cost)
bn_type : specify the bn type
Return:
N X C X H X W
"""
def __init__(self, in_channels, key_channels, scale=1, norm_layer=nn.BatchNorm2d, align_corners=True):
super(ObjectAttentionBlock2D, self).__init__()
self.scale = scale
self.in_channels = in_channels
self.key_channels = key_channels
self.align_corners = align_corners
self.pool = nn.MaxPool2d(kernel_size=(scale, scale))
self.f_pixel = nn.Sequential(nn.Conv2d(in_channels=self.in_channels, out_channels=self.key_channels, kernel_size=1, stride=1, padding=0, bias=False), nn.Sequential(norm_layer(self.key_channels), nn.ReLU(inplace=True)), nn.Conv2d(in_channels=self.key_channels, out_channels=self.key_channels, kernel_size=1, stride=1, padding=0, bias=False), nn.Sequential(norm_layer(self.key_channels), nn.ReLU(inplace=True)))
self.f_object = nn.Sequential(nn.Conv2d(in_channels=self.in_channels, out_channels=self.key_channels, kernel_size=1, stride=1, padding=0, bias=False), nn.Sequential(norm_layer(self.key_channels), nn.ReLU(inplace=True)), nn.Conv2d(in_channels=self.key_channels, out_channels=self.key_channels, kernel_size=1, stride=1, padding=0, bias=False), nn.Sequential(norm_layer(self.key_channels), nn.ReLU(inplace=True)))
self.f_down = nn.Sequential(nn.Conv2d(in_channels=self.in_channels, out_channels=self.key_channels, kernel_size=1, stride=1, padding=0, bias=False), nn.Sequential(norm_layer(self.key_channels), nn.ReLU(inplace=True)))
self.f_up = nn.Sequential(nn.Conv2d(in_channels=self.key_channels, out_channels=self.in_channels, kernel_size=1, stride=1, padding=0, bias=False), nn.Sequential(norm_layer(self.in_channels), nn.ReLU(inplace=True)))
def forward(self, x, proxy):
batch_size, h, w = (x.size(0), x.size(2), x.size(3))
if self.scale > 1:
x = self.pool(x)
query = self.f_pixel(x).view(batch_size, self.key_channels, -1)
query = query.permute(0, 2, 1)
key = self.f_object(proxy).view(batch_size, self.key_channels, -1)
value = self.f_down(proxy).view(batch_size, self.key_channels, -1)
value = value.permute(0, 2, 1)
sim_map = torch.matmul(query, key)
sim_map = self.key_channels ** (-0.5) * sim_map
sim_map = F.softmax(sim_map, dim=-1)
context = torch.matmul(sim_map, value)
context = context.permute(0, 2, 1).contiguous()
context = context.view(batch_size, self.key_channels, *x.size()[2:])
context = self.f_up(context)
if self.scale > 1:
context = F.interpolate(input=context, size=(h, w), mode='bilinear', align_corners=self.align_corners)
return context
class SpatialOCR_Module(nn.Module):
"""
Implementation of the OCR module:
We aggregate the global object representation to update the representation for each pixel.
"""
def __init__(self, in_channels, key_channels, out_channels, scale=1, dropout=0.1, norm_layer=nn.BatchNorm2d, align_corners=True):
super(SpatialOCR_Module, self).__init__()
self.object_context_block = ObjectAttentionBlock2D(in_channels, key_channels, scale, norm_layer, align_corners)
_in_channels = 2 * in_channels
self.conv_bn_dropout = nn.Sequential(nn.Conv2d(_in_channels, out_channels, kernel_size=1, padding=0, bias=False), nn.Sequential(norm_layer(out_channels), nn.ReLU(inplace=True)), nn.Dropout2d(dropout))
def forward(self, feats, proxy_feats):
context = self.object_context_block(feats, proxy_feats)
output = self.conv_bn_dropout(torch.cat([context, feats], 1))
return output
INIT_ARGS = {
'in_channels': 4,
'key_channels': 2,
'out_channels': 8,
'scale': 1,
'dropout': 0.1,
'norm_layer': nn.BatchNorm2d,
'align_corners': True,
}
ARGS = {
'feats': torch.randn(2, 4, 4, 3),
'proxy_feats': torch.randn(2, 4, 4, 3),
}
if __name__ == '__main__':
module = SpatialOCR_Module(**INIT_ARGS)
output = module(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected shape: (2, 8, 4, 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 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| XConvBnRelu |
Ran ran on a synthesized input |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("44f751550a0af371") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 16, 4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
class XConvBnRelu(nn.Module):
"""
Xception conv bn relu
"""
def __init__(self, input_dims=3, out_dims=16, **kwargs):
super(XConvBnRelu, self).__init__()
self.conv3x3 = nn.Conv2d(input_dims, input_dims, 3, 1, 1, groups=input_dims)
self.conv1x1 = nn.Conv2d(input_dims, out_dims, 1, 1, 0)
self.norm = nn.BatchNorm2d(out_dims)
self.activation = nn.ReLU()
def forward(self, x):
x = self.conv3x3(x)
x = self.conv1x1(x)
x = self.norm(x)
x = self.activation(x)
return x
INIT_ARGS = {
'input_dims': 3,
'out_dims': 16,
}
ARGS = {
'x': torch.randn(2, 3, 4, 5),
}
if __name__ == '__main__':
model = XConvBnRelu(**INIT_ARGS)
model.eval()
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.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 Tensor, ndim 4, dtype family float, shape (2, 16, 4, 5) — shape (2, 16, 4, 5) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| get_classname |
Ran ran; our contract draft was wrong, not the code |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("532fac016c7c896a") 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 str. 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
class SimpleModule(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 2)
class CustomClass:
pass
# Test with a built-in class
builtin_cls = int
# Test with a custom class
custom_cls = CustomClass
# Test with a module class
module_cls = SimpleModule
ARGS = {
'cls': custom_cls
}
- 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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_default_params |
Ran ran; our contract draft was wrong, not the code |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("93ae2e1088f964ad") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import inspect
torch.manual_seed(0)
# Create a simple test class hierarchy with default parameters
class BaseClass:
def __init__(self, param1=10, param2="default"):
self.param1 = param1
self.param2 = param2
class DerivedClass(BaseClass, nn.Module):
def __init__(self, param3=3.14, param1=5):
nn.Module.__init__(self)
BaseClass.__init__(self, param1=param1)
self.param3 = param3
# The function takes a class as input
some_class = DerivedClass
ARGS = {
"some_class": some_class
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| resize |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("55bc02c6846634c4") 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, 8, 10) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn.functional as F
torch.manual_seed(0)
# Create a small input tensor for resizing
# Shape: (batch=2, channels=3, height=4, width=5)
input_tensor = torch.randn(2, 3, 4, 5)
# Define ARGS dict with all parameters
ARGS = {
'input': input_tensor,
'size': (8, 10),
'scale_factor': None,
'mode': 'nearest',
'align_corners': None
}
- 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, 8, 10) — shape (2, 3, 8, 10) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| serialize |
Ran ran; our contract draft was wrong, not the code |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("a4cd31544f3ea2b5") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import inspect
from functools import wraps
from copy import deepcopy
torch.manual_seed(0)
# Create a minimal nn.Module subclass to test with
class SimpleModule(nn.Module):
def __init__(self, hidden_dim=64, dropout=0.1):
super().__init__()
self.linear = nn.Linear(hidden_dim, hidden_dim)
def forward(self, x):
return self.linear(x)
# Create a test function that uses serialize decorator
def test_init(self, input_size=10, output_size=5, learning_rate=0.001):
self.input_size = input_size
self.output_size = output_size
self.learning_rate = learning_rate
# Get the serialize function (it's defined in the code above)
def get_classname(cls):
module = cls.__module__
name = cls.__qualname__
if module is not None and module != '__builtin__':
name = module + '.' + name
return name
def get_default_params(some_class):
params = dict()
for mclass in some_class.mro():
if mclass is nn.Module or mclass is object:
continue
mclass_params = inspect.signature(mclass.__init__).parameters
for pname, param in mclass_params.items():
if param.default != param.empty and pname not in params:
params[pname] = param
return params
def serialize(init):
parameters = list(inspect.signature(init).parameters)
@wraps(init)
def new_init(self, *args, **kwargs):
params = deepcopy(kwargs)
for pname, value in zip(parameters[1:], args):
params[pname] = value
config = {'class': get_classname(self.__class__), 'params': dict()}
specified_params = set(params.keys())
for pname, param in get_default_params(self.__class__).items():
if pname not in params:
params[pname] = param.default
for name, value in list(params.items()):
param_type = 'builtin'
if inspect.isclass(value):
param_type = 'class'
value = get_classname(value)
config['params'][name] = {'type': param_type, 'value': value, 'specified': name in specified_params}
setattr(self, '_config', config)
init(self, *args, **kwargs)
return new_init
# The serialize function takes one parameter: init (a function)
# We need to pass a valid __init__ method
ARGS = {
'init': test_init
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| DistMaps |
Not yet run unverified (harvested, no recorded run) |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("524aba093ebca5b5") How it ran |
| HRNetModel |
Not yet run unverified (harvested, no recorded run) |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("5eac58acde5ed053") How it ran |
| HighResolutionModule |
Not yet run unverified (harvested, no recorded run) |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("c3e49580d712bb6f") How it ran |
| HighResolutionNet |
Not yet run unverified (harvested, no recorded run) |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("79f5c9927f655378") How it ran |
| ISModel |
Not yet run unverified (harvested, no recorded run) |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("0467c4cb28e2a662") How it ran |
| RefineLayer |
Not yet run unverified (harvested, no recorded run) |
XavierCHEN34/ClickSEG/isegm/model/is_hrnet_model.py code served (permissive licence) · get_code("f8c13074d5a56e32") How it ran |
| split_points_by_order |
Not yet run unverified (harvested, no recorded run) |
this paper's copy was not recorded; identical code first harvested from zmhhmz/gpcis_cvpr2023 pointer only · get_code("8bb23b71c17a0a25") How it ranThe body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded. |