SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1701.07204 · 2017

Fast Exact k-Means, k-Medians and Bregman Divergence Clustering in 1D

arXiv · PDF · Open in the Atlas

Code that ran

12 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 11 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1701.07204.json · badge: /api/ran/1701.07204.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
apple/ml-stable-diffusion community (classifier label)
classifier basis not recorded on the link
12 ran · 3 no recorded run
FunctionStatusWhere it lives
compute_psnr Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py
code served (permissive licence) · get_code("03a2c78ee113d2d7")
How it ran

Ran 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 float32, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create two small numpy arrays for testing compute_psnr
# The function expects numpy arrays that can be compared element-wise
a = np.random.randn(2, 4).astype(np.float32)
b = np.random.randn(2, 4).astype(np.float32)

ARGS = {
    "a": a,
    "b": b,
}
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 float32, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
correct_for_bias_scale_order_inversion Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/unet.py
code served (permissive licence) · get_code("b41e987fee8a92ff")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Construct the state_dict with bias and weight tensors
state_dict = {
    'layer.bias': torch.tensor([1.0, 2.0, 3.0, 4.0]),
    'layer.weight': torch.tensor([2.0, 2.0, 2.0, 2.0])
}

# Define prefix to match the keys in state_dict
prefix = 'layer.'

# Local metadata - typically empty dict for loading state dicts
local_metadata = {}

# Strict mode flag
strict = True

# Missing keys list
missing_keys = []

# Unexpected keys list
unexpected_keys = []

# Error messages list
error_msgs = []

ARGS = {
    'state_dict': state_dict,
    'prefix': prefix,
    'local_metadata': local_metadata,
    'strict': strict,
    'missing_keys': missing_keys,
    'unexpected_keys': unexpected_keys,
    'error_msgs': error_msgs
}
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 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
get_activation Ran
ran; our contract draft was wrong, not the code
apple/ml-stable-diffusion/python_coreml_stable_diffusion/unet.py
code served (permissive licence) · get_code("2f1e5140bafa7aef")
How it ran

Ran 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 SiLU. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function takes a single parameter: act_fn (a string)
# It checks if act_fn is in a list of supported activation function names
# and returns the corresponding nn activation module

ARGS = {
    'act_fn': 'swish'
}
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 SiLU — a SiLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SiLU 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_image_path Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py
code served (permissive licence) · get_code("642fa931a88fc1e7")
How it ran

Ran 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 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 os
from types import SimpleNamespace

ARGS = {
    'args': SimpleNamespace(
        o='/tmp/test_output',
        prompt='a beautiful landscape with mountains',
        seed=42,
        compute_unit='GPU',
        model_version='v1.5/base',
        scheduler='DPMSolverMultistepScheduler',
        num_inference_steps=20
    )
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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_palettizable_modules Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py
code served (permissive licence) · get_code("113401d8e5e84a63")
How it ran

Ran 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 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 logging

# Setup logging
logging.basicConfig(level=logging.INFO)

# Set seed for reproducibility
torch.manual_seed(0)

# Build a minimal UNet-like model with modules that have large enough weights
class MinimalUNet(nn.Module):
    def __init__(self):
        super().__init__()
        # Linear layer with weight size > 100000
        self.linear1 = nn.Linear(500, 250)  # 500 * 250 = 125000 params
        self.linear2 = nn.Linear(100, 50)   # 100 * 50 = 5000 params (below threshold)
        
        # Conv2d layer with weight size > 100000
        # Conv2d(in_channels, out_channels, kernel_size)
        # weight shape: (out_channels, in_channels, kernel_size, kernel_size)
        self.conv1 = nn.Conv2d(64, 128, kernel_size=3)  # 128 * 64 * 3 * 3 = 73728 (below threshold)
        self.conv2 = nn.Conv2d(256, 256, kernel_size=3)  # 256 * 256 * 3 * 3 = 589824 params
        
    def forward(self, x):
        return x

unet = MinimalUNet()

ARGS = {
    "unet": unet,
    "min_size": 100000.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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: none by the harness; any seed is in the setup block
get_resource_type Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/coreml_model.py
code served (permissive licence) · get_code("4d818e58dff62db6")
How it ran

Ran 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 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 os
import tempfile
import shutil

# Create a temporary directory structure with .mlpackage subdirectories
temp_dir = tempfile.mkdtemp()

# Create subdirectories with .mlpackage extension
package_dir_1 = os.path.join(temp_dir, "model1.mlpackage")
package_dir_2 = os.path.join(temp_dir, "model2.mlpackage")
os.makedirs(package_dir_1, exist_ok=True)
os.makedirs(package_dir_2, exist_ok=True)

ARGS = {
    "resources_dir": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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_timestep_embedding Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/unet.py
code served (permissive licence) · get_code("1b333fb5bbf14039")
How it ran

Ran 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 math

torch.manual_seed(0)

ARGS = {
    "timesteps": torch.tensor([0, 1], dtype=torch.int64),
    "embedding_dim": 4,
    "flip_sin_to_cos": False,
    "downscale_freq_shift": 1,
    "scale": 1,
    "max_period": 10000,
}
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
prepare_controlnet_cond Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py
code served (permissive licence) · get_code("18168e89cf505855")
How it ran

Ran 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 float, shape (3, 6, 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 numpy as np
from PIL import Image
import tempfile
import os

# Create a temporary test image file
temp_dir = tempfile.mkdtemp()
image_path = os.path.join(temp_dir, "test_image.png")

# Create a small test image (4x3 RGB)
test_image = Image.new('RGB', (4, 3), color=(255, 128, 64))
test_image.save(image_path)

ARGS = {
    "image_path": image_path,
    "height": 8,
    "width": 6,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (3, 6, 8) — shape (3, 6, 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: none by the harness; any seed is in the setup block
report_correctness Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py
code served (permissive licence) · get_code("9176106657a6f8cb")
How it ran

Ran 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 float32, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging
import numpy as np

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

# Create small numpy arrays with distinct values to ensure clear PSNR computation
# Use different shapes to make them distinct
original_outputs = np.random.randn(2, 4).astype(np.float32)
# Create final_outputs that is similar but not identical (will have PSNR > 35)
final_outputs = original_outputs + np.random.randn(2, 4).astype(np.float32) * 0.01

log_prefix = "test_correctness_report"

ARGS = {
    "original_outputs": original_outputs,
    "final_outputs": final_outputs,
    "log_prefix": log_prefix,
}
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 float32, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_einsum Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/attention.py
code served (permissive licence) · get_code("6b677435d1b8264e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 6, 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 math

torch.manual_seed(0)

# Analyze the function signature:
# split_einsum(q, k, v, mask, heads, dim_head)
#
# From the body:
# - q: indexed as q[:, head_idx * dim_head:(head_idx + 1) * dim_head, :, :]
#      so shape is (batch, channels, height, width) where channels = heads * dim_head
# - k: transposed to (b, w, h, c), then indexed as k[:, :, :, head_idx * dim_head:(head_idx + 1) * dim_head]
#      original shape must be (batch, dim_head*heads, height, width) before transpose
# - v: indexed as v[:, head_idx * dim_head:(head_idx + 1) * dim_head, :, :]
#      so shape is (batch, channels, height, width) where channels = heads * dim_head
# - mask: optional, added to attn_weights which has shape (batch, k_positions, height, width)
# - heads: integer, used in range()
# - dim_head: integer, used for slicing and scaling

batch = 2
heads = 2
dim_head = 3
height = 4
width = 5
total_channels = heads * dim_head

# q shape: (batch, heads * dim_head, height, width)
q = torch.randn(batch, total_channels, height, width)

# k shape: (batch, heads * dim_head, height, width)
# After transpose(1, 3): (batch, width, height, heads * dim_head)
k = torch.randn(batch, total_channels, height, width)

# v shape: (batch, heads * dim_head, height, width)
v = torch.randn(batch, total_channels, height, width)

# mask shape should match attn_weights which is (batch, k_positions, height, width)
# From einsum 'bkhq,bkhc->bkhq', k_positions comes from k's second dim after transpose
# k after transpose is (batch, width, height, heads*dim_head), so k_positions = width
mask = torch.randn(batch, width, height, width)

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "mask": mask,
    "heads": heads,
    "dim_head": dim_head,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 6, 4, 5) — shape (2, 6, 4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_einsum_v2 Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/attention.py
code served (permissive licence) · get_code("37852742dbb608cb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 32, 3, 1024) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# Parameters for split_einsum_v2
batch_size = 2
heads = 4
dim_head = 8
height = 3
query_seq_length = 1024  # Must be >= CHUNK_SIZE (512) to avoid fallback
key_seq_length = 5

# q: shape (batch, heads * dim_head, height, query_seq_length)
q = torch.randn(batch_size, heads * dim_head, height, query_seq_length)

# k: shape (batch, heads * dim_head, height, key_seq_length)
# Note: will be transposed to (batch, key_seq_length, height, heads * dim_head)
k = torch.randn(batch_size, heads * dim_head, height, key_seq_length)

# v: shape (batch, heads * dim_head, height, key_seq_length)
v = torch.randn(batch_size, heads * dim_head, height, key_seq_length)

# mask: optional attention mask, shape (batch, 1, key_seq_length, query_seq_length)
# Using None for no mask, or provide a small mask tensor
mask = None

ARGS = {
    'q': q,
    'k': k,
    'v': v,
    'mask': mask,
    'heads': heads,
    'dim_head': dim_head,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 32, 3, 1024) — shape (2, 32, 3, 1024) 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
unet_data_loader Ran
ran on a synthesized input
apple/ml-stable-diffusion/python_coreml_stable_diffusion/activation_quantization.py
code served (permissive licence) · get_code("e32b33bc6adf989c")
How it ran

Ran 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. 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 os
import pickle
import tempfile

torch.manual_seed(0)

# Create a temporary directory with pickle files containing calibration data
temp_dir = tempfile.mkdtemp()

# Create sample data: each pickle file contains a list of inputs
# Each input is a tuple/list of tensors
sample_data_1 = [
    [torch.randn(2, 4), torch.randn(2, 3)],
    [torch.randn(2, 4), torch.randn(2, 3)],
    [torch.randn(2, 4), torch.randn(2, 3)],
]

sample_data_2 = [
    [torch.randn(2, 4), torch.randn(2, 3)],
    [torch.randn(2, 4), torch.randn(2, 3)],
]

# Write pickle files
with open(os.path.join(temp_dir, 'data_1.pkl'), 'wb') as f:
    for item in sample_data_1:
        pickle.dump([item], f)

with open(os.path.join(temp_dir, 'data_2.pkl'), 'wb') as f:
    for item in sample_data_2:
        pickle.dump([item], f)

ARGS = {
    'data_dir': temp_dir,
    'device': 'cpu',
    'calibration_nsamples': 4,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bundle_resources_for_swift_cli Not yet run
unverified (harvested, no recorded run)
apple/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py
code served (permissive licence) · get_code("89b4b82b53ec08d3")
How it ran

no invocation recorded.

fake_palettize Not yet run
unverified (harvested, no recorded run)
apple/ml-stable-diffusion/python_coreml_stable_diffusion/mixed_bit_compression_pre_analysis.py
code served (permissive licence) · get_code("f30782804dc508d6")
How it ran

no invocation recorded.

softmax Not yet run
unverified (harvested, no recorded run)
apple/ml-stable-diffusion/python_coreml_stable_diffusion/attention.py
code served (permissive licence) · get_code("e47c68e7594be7c2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_activation 2 other papers
2 later
2401.03349 (2024-01)
Image Inpainting via Tractable Steering of Diffusion Models
Dai_SeaS_Few-shot_Industrial_Anomaly_Image_Generation_with_Separation_and_Sharing_ICCV_2025_paper (2025 (year only))
SeaS: Few-shot Industrial Anomaly Image Generation with Separation and Sharing Fine-tuning
correct_for_bias_scale_order_inversion 1 other paper
1 later
2212.04356 (2022-12)
Robust Speech Recognition via Large-Scale Weak Supervision

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The $k$-Means clustering problem on $n$ points is NP-Hard for any dimension $d\ge 2$, however, for the 1D case there exists exact polynomial time algorithms. Previous literature reported an $O(kn^2)$ time dynamic programming algorithm that uses $O(kn)$ space. It turns out that the problem has been considered under a different name more than twenty years ago. We present all the existing work that had been overlooked and compare the various solutions theoretically. Moreover, we show how to reduce the space usage for some of them, as well as generalize them to data structures that can quickly report an optimal $k$-Means clustering for any $k$. Finally we also generalize all the algorithms to work for the absolute distance and to work for any Bregman Divergence. We complement our theoretical contributions by experiments that compare the practical performance of the various algorithms.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1701.07204")
get_code_for_paper("1701.07204")
have("1701.07204")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1701.07204.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1701.07204.svg)](https://syntology.ai/paper/1701.07204)

Connect an agent — have() is free.