SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.04558 · ICLR · 2021

FastSpeech 2: Fast and High-Quality End-to-End Text to Speech

Yi Ren, Tao Qin, Tie-Yan Liu, Xu Tan, Chenxu Hu, Sheng Zhao, Zhou Zhao

arXiv · PDF · Open in the Atlas

Code that ran

83 of 119 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (27 of them constructed an object rather than computing a result; 10 honoured the contract we drafted, 3 violated it and 55 have no contract verdict; 15 failures of our instrument; 36 no recorded run), measured 2026-11-21; 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/2006.04558.json · badge: /api/ran/2006.04558.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
dathudeptrai/TensorflowTTS community
Papers with Code archive
15 ran · 6 no recorded run
tartunlp/transformertts community
Papers with Code archive
14 ran · 8 no recorded run
ndkgit339/fastspeech2-filled_pause_speech_synthesis community
Papers with Code archive
11 ran · 4 no recorded run
shivammehta25/BetterFastSpeech2 community (classifier label)
classifier basis not recorded on the link
10 ran · 1 no recorded run
keonlee9420/Comprehensive-Transformer-TTS community
Papers with Code archive
8 ran · 3 no recorded run
KevinMIN95/StyleSpeech community
Papers with Code archive
6 ran · 2 no recorded run
OlaWod/my-fastspeech2 community
Papers with Code archive
5 ran · 6 no recorded run
rishikksh20/FastSpeech2 community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
galaxycong/hpmdubbing community
Papers with Code archive
3 ran · 0 no recorded run
roedoejet/fastspeech2 community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
mtresearcher/FastSpeech2 community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
cadia-lvl/fastspeech2 community (classifier label)
classifier basis not recorded on the link
1 ran · 1 no recorded run
keonlee9420/STYLER community
not in the paper's declared repositories
1 ran · 0 no recorded run
Munna-Manoj/Team6_FastSpeech2_TTS community
Papers with Code archive
0 ran · 2 no recorded run
yoshifumi-nakano/visual-text-to-speech community
not in the paper's declared repositories
0 ran · 2 no recorded run
wataru-nakata/fastspeech2-jsut community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Affective_Prosody_Adaptor Ran
ran on a synthesized input · constructed an object; no result was computed
galaxycong/hpmdubbing/model/modules.py
code served (permissive licence) · get_code("f25cee181e5607fa")
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 an instance of its own class, Affective_Prosody_Adaptor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import json
import os
import tempfile
from collections import OrderedDict

torch.manual_seed(0)

# Create a temporary directory for stats.json
temp_dir = tempfile.mkdtemp()
stats_path = os.path.join(temp_dir, 'stats.json')

# Write stats.json
stats = {
    'pitch': [100.0, 500.0, 0.0],
    'energy': [0.5, 2.0, 0.0]
}
with open(stats_path, 'w') as f:
    json.dump(stats, f)

# Build preprocess_config
preprocess_config = {
    'dataset': 'test_dataset',
    'path': {
        'preprocessed_path': temp_dir
    },
    'preprocessing': {
        'pitch': {
            'feature': 'phoneme_level'
        },
        'energy': {
            'feature': 'phoneme_level'
        }
    }
}

# Build model_config
model_config = {
    'transformer': {
        'encoder_hidden': 256
    },
    'variance_predictor': {
        'filter_size': 256,
        'kernel_size': 3,
        'dropout': 0.5,
        'predictor': 'duration'
    },
    'variance_embedding': {
        'pitch_quantization': 'linear',
        'energy_quantization': 'linear',
        'n_bins': 256
    },
    'Affective_Prosody_Adaptor': {
        'Use_Scale_attention': True
    },
    'loss_function': {
        'model': 'mse'
    }
}

ARGS = {
    'preprocess_config': preprocess_config,
    'model_config': model_config
}
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 Affective_Prosody_Adaptor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Affective_Prosody_Adaptor 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
Attention Ran
ran on a synthesized input
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("dfedf95397e85d63")
How it ran

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

import torch
import torch.nn as nn
import torch.nn.functional as F

# Define INIT_ARGS for Attention.__init__
INIT_ARGS = {
    'attention_rnn_dim': 8,
    'embedding_dim': 6,
    'attention_dim': 4,
    'attention_location_n_filters': 3,
    'attention_location_kernel_size': 5,
}

# Define ARGS for Attention.forward
ARGS = {
    'attention_hidden_state': torch.randn(2, 8),  # batch=2, attention_rnn_dim=8
    'memory': torch.randn(2, 7, 6),  # batch=2, max_time=7, embedding_dim=6
    'processed_memory': torch.randn(2, 7, 4),  # batch=2, max_time=7, attention_dim=4
    'attention_weights_cat': torch.randn(2, 2, 7),  # batch=2, 2 channels, max_time=7
    'mask': None,  # no mask for this test
}

# Construct and call the class
if __name__ == '__main__':
    # Construct the Attention module
    attention_module = nn.Module()
    
    # Manually build the submodules to match the Attention class structure
    class ConvNorm(torch.nn.Module):
        def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=None, dilation=1, bias=True, w_init_gain='linear'):
            super(ConvNorm, self).__init__()
            if padding is None:
                assert kernel_size % 2 == 1
                padding = int(dilation * (kernel_size - 1) / 2)
            self.conv = torch.nn.Conv1d(in_channels, out_channels, kernel_size=kernel_size, stride=stride, padding=padding, dilation=dilation, bias=bias)
            torch.nn.init.xavier_uniform_(self.conv.weight, gain=torch.nn.init.calculate_gain(w_init_gain))

        def forward(self, signal):
            conv_signal = self.conv(signal)
            return conv_signal

    class LinearNorm(nn.Module):
        def __init__(self, in_dim, out_dim, bias=True, w_init_gain='linear'):
            super(LinearNorm, self).__init__()
            self.linear_layer = nn.Linear(in_dim, out_dim, bias=bias)
            torch.nn.init.xavier_uniform_(self.linear_layer.weight, gain=torch.nn.init.calculate_gain(w_init_gain))

        def forward(self, x):
            return self.linear_layer(x)

    class LocationLayer(nn.Module):
        def __init__(self, attention_n_filters, attention_kernel_size, attention_dim):
            super(LocationLayer, self).__init__()
            padding = int((attention_kernel_size - 1) / 2)
            self.location_conv = ConvNorm(2, attention_n_filters, kernel_size=attention_kernel_size, padding=padding, bias=False, stride=1, dilation=1)
            self.location_dense = LinearNorm(attention_n_filters, attention_dim, bias=False, w_init_gain='tanh')

        def forward(self, attention_weights_cat):
            processed_attention = self.location_conv(attention_weights_cat)
            processed_attention = processed_attention.transpose(1, 2)
            processed_attention = self.location_dense(processed_attention)
            return processed_attention

    class Attention(nn.Module):
        def __init__(self, attention_rnn_dim, embedding_dim, attention_dim, attention_location_n_filters, attention_location_kernel_size):
            super(Attention, self).__init__()
            self.query_layer = LinearNorm(attention_rnn_dim, attention_dim, bias=False, w_init_gain='tanh')
            self.memory_layer = LinearNorm(embedding_dim, attention_dim, bias=False, w_init_gain='tanh')
            self.v = LinearNorm(attention_dim, 1, bias=False)
            self.location_layer = LocationLayer(attention_location_n_filters, attention_location_kernel_size, attention_dim)
            self.score_mask_value = -float('inf')

        def get_alignment_energies(self, query, processed_memory, attention_weights_cat):
            processed_query = self.query_layer(query.unsqueeze(1))
            processed_attention_weights = self.location_layer(attention_weights_cat)
            energies = self.v(torch.tanh(processed_query + processed_attention_weights + processed_memory))
            energies = energies.squeeze(-1)
            return energies

        def forward(self, attention_hidden_state, memory, processed_memory, attention_weights_cat, mask):
            alignment = self.get_alignment_energies(attention_hidden_state, processed_memory, attention_weights_cat)
            if mask is not None:
                alignment.data.masked_fill_(mask, self.score_mask_value)
            attention_weights = F.softmax(alignment, dim=1)
            attention_context = torch.bmm(attention_weights.unsqueeze(1), memory)
            attention_context = attention_context.squeeze(1)
            return (attention_context, attention_weights)

    # Instantiate the Attention module
    attention = Attention(**INIT_ARGS)
    
    # Call the forward method
    output = attention(**ARGS)
    
    print("Output shapes:")
    print(f"  attention_context: {output[0].shape}")
    print(f"  attention_weights: {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 — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
BatchNorm1dTBC Ran
ran on a synthesized input · constructed an object; no result was computed
keonlee9420/Comprehensive-Transformer-TTS/model/transformers/transformer_fs2.py
code served (permissive licence) · get_code("36b7d7479f2890e3")
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 an instance of its own class, BatchNorm1dTBC: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'c': 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 BatchNorm1dTBC — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BatchNorm1dTBC 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
CNNDropout Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("d5e9a425417e7d5f")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

CNNResNorm Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("8882509c8098093d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

Conv Ran
ran on a synthesized input · constructed an object; no result was computed
galaxycong/hpmdubbing/model/modules.py
code served (permissive licence) · get_code("d23d53aa9e38b09c")
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 an instance of its own class, Conv: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_channels': 4,
    'out_channels': 8,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1,
    'bias': True,
    'w_init': 'linear'
}
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 Conv — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Conv 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
ConvNorm Ran
ran on a synthesized input · constructed an object; no result was computed
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("07bf5346a131cbc4")
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 an instance of its own class, ConvNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_channels': 16,
    'out_channels': 32,
    'kernel_size': 3,
    'stride': 1,
    'padding': None,
    'dilation': 1,
    'bias': True,
    'w_init_gain': 'linear'
}
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 ConvNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ConvNorm 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
ConvNorm Ran
ran on a synthesized input · constructed an object; no result was computed
KevinMIN95/StyleSpeech/models/VarianceAdaptor.py
code served (permissive licence) · get_code("c571f7fcdaecbe31")
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 an instance of its own class, ConvNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# ConvNorm constructor parameters:
# in_channels, out_channels, kernel_size=1, stride=1, padding=None, dilation=1, bias=True, spectral_norm=False

ARGS = {
    "in_channels": 4,
    "out_channels": 8,
    "kernel_size": 3,
    "stride": 1,
    "padding": None,
    "dilation": 1,
    "bias": True,
    "spectral_norm": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConvNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ConvNorm 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
CustomSwish Ran
ran on a synthesized input
keonlee9420/Comprehensive-Transformer-TTS/model/transformers/transformer_fs2.py
code served (permissive licence) · get_code("962a3fc96762fd76")
How it ran

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

import torch
import torch.nn as nn

class Swish(torch.autograd.Function):

    @staticmethod
    def forward(ctx, i):
        result = i * torch.sigmoid(i)
        ctx.save_for_backward(i)
        return result

    @staticmethod
    def backward(ctx, grad_output):
        i = ctx.saved_variables[0]
        sigmoid_i = torch.sigmoid(i)
        return grad_output * (sigmoid_i * (1 + i * (1 - sigmoid_i)))

class CustomSwish(nn.Module):

    def forward(self, input_tensor):
        return Swish.apply(input_tensor)


INIT_ARGS = {}

ARGS = {
    'input_tensor': torch.randn(2, 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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("6f4b8f2a7bb4e97e")
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 an instance of its own class, Encoder: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class HParams:
    def __init__(self):
        self.encoder_n_convolutions = 2
        self.encoder_embedding_dim = 4
        self.encoder_kernel_size = 3

hparams = HParams()

ARGS = {
    'hparams': hparams
}
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 Encoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Encoder 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
FFTBlock Ran
ran on a synthesized input
OlaWod/my-fastspeech2/model/model.py
pointer only (licence: NONE) · get_code("8e0eec498dd5a07b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, OlaWod/my-fastspeech2 when it was checked. 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. A run is recorded.

LayerNorm Ran
ran on a synthesized input · constructed an object; no result was computed
keonlee9420/Comprehensive-Transformer-TTS/model/transformers/transformer_fs2.py
code served (permissive licence) · get_code("dfb900695221fe2d")
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 an instance of its own class, LayerNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "nout": 8,
    "dim": -1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LayerNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LayerNorm output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
LengthRegulator Ran
ran on a synthesized input
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("e5a136f268af8988")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

# Override device to CPU only
device = torch.device('cpu')

def pad(input_ele, mel_max_length=None):
    if mel_max_length:
        max_len = mel_max_length
    else:
        max_len = max([input_ele[i].size(0) for i in range(len(input_ele))])
    out_list = list()
    for i, batch in enumerate(input_ele):
        if len(batch.shape) == 1:
            one_batch_padded = F.pad(batch, (0, max_len - batch.size(0)), 'constant', 0.0)
        elif len(batch.shape) == 2:
            one_batch_padded = F.pad(batch, (0, 0, 0, max_len - batch.size(0)), 'constant', 0.0)
        out_list.append(one_batch_padded)
    out_padded = torch.stack(out_list)
    return out_padded

class LengthRegulator(nn.Module):
    """ Length Regulator """

    def __init__(self):
        super(LengthRegulator, self).__init__()

    def LR(self, x, duration, max_len):
        output = list()
        mel_len = list()
        for batch, expand_target in zip(x, duration):
            expanded = self.expand(batch, expand_target)
            output.append(expanded)
            mel_len.append(expanded.shape[0])
        if max_len is not None:
            output = pad(output, max_len)
        else:
            output = pad(output)
        return (output, torch.LongTensor(mel_len).to(device))

    def expand(self, batch, predicted):
        out = list()
        for i, vec in enumerate(batch):
            expand_size = predicted[i].item()
            out.append(vec.expand(max(int(expand_size), 0), -1))
        out = torch.cat(out, 0)
        return out

    def forward(self, x, duration, max_len):
        output, mel_len = self.LR(x, duration, max_len)
        return (output, mel_len)


# INIT_ARGS: no parameters for __init__
INIT_ARGS = {}

# ARGS: parameters for forward method
# x: batch of 2 sequences, each with 3 timesteps and 4 features
# duration: batch of 2 duration tensors, each with 3 elements (expansion factors)
# max_len: maximum length for padding (set to None to auto-compute)
ARGS = {
    'x': [
        torch.randn(3, 4),  # First sequence: 3 timesteps, 4 features
        torch.randn(5, 4),  # Second sequence: 5 timesteps, 4 features
    ],
    'duration': [
        torch.tensor([2.0, 1.0, 3.0]),  # Expansion factors for first sequence
        torch.tensor([1.0, 2.0, 1.0, 1.0, 2.0]),  # Expansion factors for second sequence
    ],
    'max_len': None,
}

# Construct and call
if __name__ == '__main__':
    model = LengthRegulator(**INIT_ARGS)
    output, mel_len = model(**ARGS)
    print("Output shape:", output.shape)
    print("Mel lengths:", mel_len)
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 — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LengthRegulator Ran
ran on a synthesized input
keonlee9420/STYLER/modules.py
code served (permissive licence) · get_code("b0463abb38c1cc46")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F
import types as _types

device = torch.device('cpu')

def pad(input_ele, mel_max_length=None):
    if mel_max_length:
        max_len = mel_max_length
    else:
        max_len = max([input_ele[i].size(0) for i in range(len(input_ele))])
    out_list = list()
    for i, batch in enumerate(input_ele):
        if len(batch.shape) == 1:
            one_batch_padded = F.pad(batch, (0, max_len - batch.size(0)), 'constant', 0.0)
        elif len(batch.shape) == 2:
            one_batch_padded = F.pad(batch, (0, 0, 0, max_len - batch.size(0)), 'constant', 0.0)
        out_list.append(one_batch_padded)
    out_padded = torch.stack(out_list)
    return out_padded

class LengthRegulator(nn.Module):
    """ Length Regulator """

    def __init__(self):
        super(LengthRegulator, self).__init__()

    def LR(self, x, duration, max_len):
        output = list()
        mel_len = list()
        for batch, expand_target in zip(x, duration):
            expanded = self.expand(batch, expand_target)
            output.append(expanded)
            mel_len.append(expanded.shape[0])
        if max_len is not None:
            output = utils.pad(output, max_len)
        else:
            output = utils.pad(output)
        return (output, torch.LongTensor(mel_len).to(device))

    def expand(self, batch, predicted):
        out = list()
        for i, vec in enumerate(batch):
            expand_size = predicted[i].item()
            out.append(vec.expand(int(expand_size), -1))
        out = torch.cat(out, 0)
        return out

    def forward(self, x, duration, max_len):
        output, mel_len = self.LR(x, duration, max_len)
        return (output, mel_len)


utils = _types.SimpleNamespace(**{n: globals()[n] for n in ['device', 'pad'] if n in globals()})

INIT_ARGS = {}

ARGS = {
    'x': [
        torch.randn(3, 4),
        torch.randn(2, 4),
    ],
    'duration': [
        torch.tensor([2, 1, 3]),
        torch.tensor([1, 2]),
    ],
    'max_len': None,
}

if __name__ == '__main__':
    model = LengthRegulator(**INIT_ARGS)
    output, mel_len = model(**ARGS)
    print("Output shape:", output.shape)
    print("Mel lengths:", mel_len)
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 — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LengthRegulator Ran
ran on a synthesized input · constructed an object; no result was computed
KevinMIN95/StyleSpeech/models/VarianceAdaptor.py
code served (permissive licence) · get_code("dc95367aea71c89c")
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 an instance of its own class, LengthRegulator: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.nn import functional as F
import numpy as np

torch.manual_seed(0)

def get_sinusoid_encoding_table(n_position, d_hid, padding_idx=None):
    """ Sinusoid position encoding table """

    def cal_angle(position, hid_idx):
        return position / np.power(10000, 2 * (hid_idx // 2) / d_hid)

    def get_posi_angle_vec(position):
        return [cal_angle(position, hid_j) for hid_j in range(d_hid)]
    sinusoid_table = np.array([get_posi_angle_vec(pos_i) for pos_i in range(n_position)])
    sinusoid_table[:, 0::2] = np.sin(sinusoid_table[:, 0::2])
    sinusoid_table[:, 1::2] = np.cos(sinusoid_table[:, 1::2])
    if padding_idx is not None:
        sinusoid_table[padding_idx] = 0.0
    return torch.FloatTensor(sinusoid_table)

def pad(input_ele, mel_max_length=None):
    if mel_max_length:
        max_len = mel_max_length
    else:
        max_len = max([input_ele[i].size(0) for i in range(len(input_ele))])
    out_list = list()
    for i, batch in enumerate(input_ele):
        if len(batch.shape) == 1:
            one_batch_padded = F.pad(batch, (0, max_len - batch.size(0)), 'constant', 0.0)
        elif len(batch.shape) == 2:
            one_batch_padded = F.pad(batch, (0, 0, 0, max_len - batch.size(0)), 'constant', 0.0)
        out_list.append(one_batch_padded)
    out_padded = torch.stack(out_list)
    return out_padded

class LengthRegulator(nn.Module):
    """ Length Regulator """

    def __init__(self, hidden_size, max_pos):
        super(LengthRegulator, self).__init__()
        self.position_enc = nn.Parameter(get_sinusoid_encoding_table(max_pos + 1, hidden_size), requires_grad=False)

    def LR(self, x, duration, max_len):
        output = list()
        position = list()
        mel_len = list()
        for batch, expand_target in zip(x, duration):
            expanded, pos = self.expand(batch, expand_target)
            output.append(expanded)
            position.append(pos)
            mel_len.append(expanded.shape[0])
        if max_len is not None:
            output = pad(output, max_len)
            position = pad(position, max_len)
        else:
            output = pad(output)
            position = pad(position)
        return (output, position, torch.LongTensor(mel_len))

    def expand(self, batch, predicted):
        out = list()
        pos = list()
        for i, vec in enumerate(batch):
            expand_size = predicted[i].item()
            out.append(vec.expand(int(expand_size), -1))
            pos.append(self.position_enc[:expand_size, :])
        out = torch.cat(out, 0)
        pos = torch.cat(pos, 0)
        return (out, pos)

    def forward(self, x, duration, max_len=None):
        output, position, mel_len = self.LR(x, duration, max_len)
        return (output, position, mel_len)

ARGS = {
    "hidden_size": 4,
    "max_pos": 16
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LengthRegulator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LengthRegulator 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
LinearNorm Ran
ran on a synthesized input · constructed an object; no result was computed
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("ca22033a787f63fb")
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 an instance of its own class, LinearNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_dim': 4,
    'out_dim': 3,
    'bias': True,
    'w_init_gain': 'linear'
}
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 LinearNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LinearNorm 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
LinearNorm Ran
ran on a synthesized input · constructed an object; no result was computed
KevinMIN95/StyleSpeech/models/VarianceAdaptor.py
code served (permissive licence) · get_code("6ebf70e53b0eb6cd")
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 an instance of its own class, LinearNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small input tensor for testing
# Shape: (batch_size=2, in_channels=4)
input_tensor = torch.randn(2, 4)

# Define arguments for LinearNorm
ARGS = {
    'in_channels': 4,
    'out_channels': 3,
    'bias': True,
    'spectral_norm': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LinearNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LinearNorm 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
LocationLayer Ran
ran on a synthesized input · constructed an object; no result was computed
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("2d670fbff60b3396")
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 an instance of its own class, LocationLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "attention_n_filters": 8,
    "attention_kernel_size": 3,
    "attention_dim": 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 LocationLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LocationLayer 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
MultiHeadAttention Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("0d6a9c2615231e6a")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

MultiHeadAttention Ran
ran on a synthesized input
OlaWod/my-fastspeech2/model/model.py
pointer only (licence: NONE) · get_code("633b426a0ece94c3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, OlaWod/my-fastspeech2 when it was checked. 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. A run is recorded.

MultiheadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
keonlee9420/Comprehensive-Transformer-TTS/model/transformers/transformer_fs2.py
code served (permissive licence) · get_code("91289eb6932cf19a")
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 an instance of its own class, MultiheadAttention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal valid configuration for MultiheadAttention
embed_dim = 8
num_heads = 2
kdim = 8
vdim = 8
dropout = 0.1
bias = True
add_bias_kv = False
add_zero_attn = False
self_attention = True
encoder_decoder_attention = False

ARGS = {
    "embed_dim": embed_dim,
    "num_heads": num_heads,
    "kdim": kdim,
    "vdim": vdim,
    "dropout": dropout,
    "bias": bias,
    "add_bias_kv": add_bias_kv,
    "add_zero_attn": add_zero_attn,
    "self_attention": self_attention,
    "encoder_decoder_attention": encoder_decoder_attention,
}
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 MultiheadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiheadAttention 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
Phonemizer Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("3bbdc525d00b1109")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

PositionwiseFeedForward Ran
ran on a synthesized input
OlaWod/my-fastspeech2/model/model.py
pointer only (licence: NONE) · get_code("06c86d0f5a38e81d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, OlaWod/my-fastspeech2 when it was checked. 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. A run is recorded.

PostNet Ran
ran on a synthesized input · constructed an object; no result was computed
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("9b21f04966dfe516")
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 an instance of its own class, PostNet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'n_mel_channels': 80,
    'postnet_embedding_dim': 512,
    'postnet_kernel_size': 5,
    'postnet_n_convolutions': 5,
}
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 PostNet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PostNet 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
PostNet Ran
ran on a synthesized input
OlaWod/my-fastspeech2/model/model.py
pointer only (licence: NONE) · get_code("3b072d38fff02018")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, OlaWod/my-fastspeech2 when it was checked. 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. A run is recorded.

Prenet Ran
ran on a synthesized input · constructed an object; no result was computed
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("14b683ae99e4b188")
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 an instance of its own class, Prenet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define the Prenet class and its dependencies
class LinearNorm(nn.Module):

    def __init__(self, in_dim, out_dim, bias=True, w_init_gain='linear'):
        super(LinearNorm, self).__init__()
        self.linear_layer = nn.Linear(in_dim, out_dim, bias=bias)
        torch.nn.init.xavier_uniform_(self.linear_layer.weight, gain=torch.nn.init.calculate_gain(w_init_gain))

    def forward(self, x):
        return self.linear_layer(x)

class Prenet(nn.Module):

    def __init__(self, in_dim, sizes):
        super(Prenet, self).__init__()
        in_sizes = [in_dim] + sizes[:-1]
        self.layers = nn.ModuleList([LinearNorm(in_size, out_size, bias=False) for in_size, out_size in zip(in_sizes, sizes)])

    def forward(self, x):
        for linear in self.layers:
            x = F.dropout(F.relu(linear(x)), p=0.5, training=True)
        return x

# Construct valid arguments for Prenet
ARGS = {
    'in_dim': 4,
    'sizes': [8, 6, 3]
}
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 Prenet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Prenet 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
ScaledDotProductAttention Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("27a396b3518d14df")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

ScaledDotProductAttention Ran
ran on a synthesized input
OlaWod/my-fastspeech2/model/model.py
pointer only (licence: NONE) · get_code("0c79a4f8468a65bc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, OlaWod/my-fastspeech2 when it was checked. 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. A run is recorded.

SelfAttentionResNorm Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("ac9cdd8c4dc1592a")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

SinusoidalPositionalEmbedding Ran
ran on a synthesized input
keonlee9420/Comprehensive-Transformer-TTS/model/transformers/transformer_fs2.py
code served (permissive licence) · get_code("3305668af12f291b")
How it ran

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

def make_positions(tensor, padding_idx):
    """Replace non-padding symbols with their position numbers.

    Position numbers begin at padding_idx+1. Padding symbols are ignored.
    """
    mask = tensor.ne(padding_idx).int()
    return (torch.cumsum(mask, dim=1).type_as(mask) * mask).long() + padding_idx

class SinusoidalPositionalEmbedding(nn.Module):
    """This module produces sinusoidal positional embeddings of any length.

    Padding symbols are ignored.
    """

    def __init__(self, embedding_dim, padding_idx, init_size=1024):
        super().__init__()
        self.embedding_dim = embedding_dim
        self.padding_idx = padding_idx
        self.weights = SinusoidalPositionalEmbedding.get_embedding(init_size, embedding_dim, padding_idx)
        self.register_buffer('_float_tensor', torch.FloatTensor(1))

    @staticmethod
    def get_embedding(num_embeddings, embedding_dim, padding_idx=None):
        """Build sinusoidal embeddings.

        This matches the implementation in tensor2tensor, but differs slightly
        from the description in Section 3.5 of "Attention Is All You Need".
        """
        half_dim = embedding_dim // 2
        emb = math.log(10000) / (half_dim - 1)
        emb = torch.exp(torch.arange(half_dim, dtype=torch.float) * -emb)
        emb = torch.arange(num_embeddings, dtype=torch.float).unsqueeze(1) * emb.unsqueeze(0)
        emb = torch.cat([torch.sin(emb), torch.cos(emb)], dim=1).view(num_embeddings, -1)
        if embedding_dim % 2 == 1:
            emb = torch.cat([emb, torch.zeros(num_embeddings, 1)], dim=1)
        if padding_idx is not None:
            emb[padding_idx, :] = 0
        return emb

    def forward(self, input, incremental_state=None, timestep=None, positions=None, **kwargs):
        """Input is expected to be of size [bsz x seqlen]."""
        bsz, seq_len = input.shape[:2]
        max_pos = self.padding_idx + 1 + seq_len
        if self.weights is None or max_pos > self.weights.size(0):
            self.weights = SinusoidalPositionalEmbedding.get_embedding(max_pos, self.embedding_dim, self.padding_idx)
        self.weights = self.weights.to(self._float_tensor)
        if incremental_state is not None:
            pos = timestep.view(-1)[0] + 1 if timestep is not None else seq_len
            return self.weights[self.padding_idx + pos, :].expand(bsz, 1, -1)
        positions = make_positions(input, self.padding_idx) if positions is None else positions
        return self.weights.index_select(0, positions.view(-1)).view(bsz, seq_len, -1).detach()

    def max_positions(self):
        """Maximum number of supported positions."""
        return int(100000.0)

INIT_ARGS = {
    'embedding_dim': 8,
    'padding_idx': 0,
    'init_size': 16
}

ARGS = {
    'input': torch.tensor([[1, 2, 3, 4, 0], [5, 6, 0, 0, 0]], dtype=torch.long),
    'incremental_state': None,
    'timestep': None,
    'positions': None
}
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)
StatPredictor Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("fc2705c21133a77b")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

Swish Ran
ran on a synthesized input · constructed an object; no result was computed
keonlee9420/Comprehensive-Transformer-TTS/model/transformers/transformer_fs2.py
code served (permissive licence) · get_code("503cd450156c2a84")
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 an instance of its own class, Swish: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Swish.forward takes ctx and i (an input tensor)
# Swish.backward takes ctx and grad_output (gradient tensor)
# The function uses:
# - i: a tensor (any shape, used with torch.sigmoid and arithmetic)
# - ctx.save_for_backward: saves tensors for backward pass
# - grad_output: a tensor of same shape as output

# Create a small input tensor
input_tensor = torch.randn(2, 4, requires_grad=True)

ARGS = {
    "i": input_tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Swish — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Swish 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
TFEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("a2368c41158a0b44")
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 an instance of its own class, TFEmbedding: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf

class TFEmbedding(tf.keras.layers.Embedding):
    """Faster version of embedding."""

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def call(self, inputs):
        inputs = tf.cast(inputs, tf.int32)
        outputs = tf.gather(self.embeddings, inputs)
        return outputs


# Construct arguments for TFEmbedding
# TFEmbedding inherits from tf.keras.layers.Embedding
# Key parameters: input_dim (vocab size), output_dim (embedding dimension)
# The call method expects inputs to be token indices that will be gathered from embeddings

input_dim = 10  # vocabulary size
output_dim = 4  # embedding dimension

ARGS = {
    'input_dim': input_dim,
    'output_dim': output_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFEmbedding 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
TFFastSpeechDurationPredictor Ran
ran on a synthesized input
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("115bba4b6af8210e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned EagerTensor, 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 tensorflow as tf

# Configuration object
class DurationPredictorConfig:
    def __init__(self):
        self.num_duration_conv_layers = 2
        self.duration_predictor_filters = 16
        self.duration_predictor_kernel_sizes = 3
        self.layer_norm_eps = 1e-5
        self.duration_predictor_dropout_probs = 0.1

config = DurationPredictorConfig()

INIT_ARGS = {
    'config': config
}

# Create sample inputs: (batch_size=2, sequence_length=5, hidden_size=4)
encoder_hidden_states = tf.random.normal((2, 5, 4), dtype=tf.float32)
# Attention mask: (batch_size=2, sequence_length=5)
attention_mask = tf.ones((2, 5), dtype=tf.int32)

ARGS = {
    'inputs': (encoder_hidden_states, attention_mask),
    'training': False
}

# Construct and call the class
duration_predictor = tf.keras.layers.Layer.__new__(
    type('TFFastSpeechDurationPredictor', (tf.keras.layers.Layer,), {
        '__init__': lambda self, config, **kwargs: (
            super(type(self), self).__init__(**kwargs),
            setattr(self, 'conv_layers', []),
            [self.conv_layers.extend([
                tf.keras.layers.Conv1D(config.duration_predictor_filters, config.duration_predictor_kernel_sizes, padding='same', name=f'conv_._{i}'),
                tf.keras.layers.LayerNormalization(epsilon=config.layer_norm_eps, name=f'LayerNorm_._{i}'),
                tf.keras.layers.Activation(tf.nn.relu6),
                tf.keras.layers.Dropout(config.duration_predictor_dropout_probs)
            ]) for i in range(config.num_duration_conv_layers)],
            setattr(self, 'conv_layers_sequence', tf.keras.Sequential(self.conv_layers)),
            setattr(self, 'output_layer', tf.keras.layers.Dense(1))
        )[-1],
        'call': lambda self, inputs, training=False: (
            lambda encoder_hidden_states, attention_mask: (
                lambda attention_mask: (
                    lambda masked_encoder_hidden_states: (
                        lambda outputs: (
                            lambda masked_outputs: tf.squeeze(tf.nn.relu6(masked_outputs), -1)
                        )(outputs * attention_mask)
                    )(self.output_layer(self.conv_layers_sequence(masked_encoder_hidden_states)))
                )(encoder_hidden_states * attention_mask)
            )(tf.cast(tf.expand_dims(attention_mask, 2), encoder_hidden_states.dtype))
        )(*inputs)
    })
)

duration_predictor.__init__(config)
result = duration_predictor(ARGS['inputs'], training=ARGS['training'])
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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)
TFFastSpeechEmbeddings Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("d03b27155c241e9b")
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 an instance of its own class, TFFastSpeechEmbeddings: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

class MockEncoderSelfAttentionParams:
    def __init__(self):
        self.hidden_size = 8

class MockConfig:
    def __init__(self):
        self.vocab_size = 16
        self.encoder_self_attention_params = MockEncoderSelfAttentionParams()
        self.initializer_range = 0.02
        self.max_position_embeddings = 32
        self.n_speakers = 2

config = MockConfig()

# Prepare inputs
batch_size = 2
seq_length = 5
input_ids = tf.constant([[1, 2, 3, 4, 5], [5, 4, 3, 2, 1]], dtype=tf.int32)
speaker_ids = tf.constant([0, 1], dtype=tf.int32)

inputs = (input_ids, speaker_ids)

ARGS = {
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFFastSpeechEmbeddings — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFFastSpeechEmbeddings 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
TFFastSpeechIntermediate Ran
ran on a synthesized input
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("83e5495df3b935d4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned EagerTensor, 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 tensorflow as tf
import numpy as np

class Config:
    def __init__(self):
        self.hidden_size = 8
        self.intermediate_size = 12
        self.intermediate_kernel_size = 3
        self.initializer_range = 0.02
        self.hidden_act = 'gelu'

config = Config()

INIT_ARGS = {
    'config': config
}

# Create input tensors for the call method
# hidden_states: (batch_size, sequence_length, hidden_size)
# attention_mask: (batch_size, sequence_length)
batch_size = 2
sequence_length = 5

hidden_states = tf.random.normal((batch_size, sequence_length, config.hidden_size))
attention_mask = tf.ones((batch_size, sequence_length), dtype=tf.int32)

ARGS = {
    'inputs': (hidden_states, attention_mask)
}

METHOD = 'call'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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)
TFFastSpeechLengthRegulator Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("13cdbe4e5b8db636")
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 an instance of its own class, TFFastSpeechLengthRegulator: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf

class MockEncoderSelfAttentionParams:
    def __init__(self):
        self.hidden_size = 4

class MockConfig:
    def __init__(self):
        self.encoder_self_attention_params = MockEncoderSelfAttentionParams()

# Create a minimal config
config = MockConfig()

# Create input tensors
batch_size = 2
seq_length = 3
hidden_size = 4

# encoder_hidden_states: [batch_size, length, hidden_size]
encoder_hidden_states = tf.constant(
    [[[0.1, 0.2, 0.3, 0.4],
      [0.5, 0.6, 0.7, 0.8],
      [0.9, 1.0, 1.1, 1.2]],
     [[1.3, 1.4, 1.5, 1.6],
      [1.7, 1.8, 1.9, 2.0],
      [2.1, 2.2, 2.3, 2.4]]],
    dtype=tf.float32
)

# durations_gt: [batch_size, length]
durations_gt = tf.constant(
    [[2, 1, 3],
     [1, 2, 2]],
    dtype=tf.int32
)

ARGS = {
    'config': config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFFastSpeechLengthRegulator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFFastSpeechLengthRegulator 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
TFFastSpeechOutput Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("082dc93c13b04ed5")
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 an instance of its own class, TFFastSpeechOutput: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf

class MockConfig:
    """Mock config class with required attributes."""
    def __init__(self):
        self.layer_norm_eps = 1e-5
        self.hidden_dropout_prob = 0.1

config = MockConfig()

# Create small test tensors: batch_size=2, hidden_dim=4
hidden_states = tf.constant([
    [[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]],
    [[9.0, 10.0, 11.0, 12.0], [13.0, 14.0, 15.0, 16.0]]
], dtype=tf.float32)

input_tensor = tf.constant([
    [[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]],
    [[0.9, 1.0, 1.1, 1.2], [1.3, 1.4, 1.5, 1.6]]
], dtype=tf.float32)

ARGS = {
    'config': config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFFastSpeechOutput — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFFastSpeechOutput 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
TFFastSpeechSelfAttention Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("84c3fd85ad516f46")
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 an instance of its own class, TFFastSpeechSelfAttention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf

class Config:
    """Minimal config class for TFFastSpeechSelfAttention."""
    def __init__(self):
        self.hidden_size = 16
        self.num_attention_heads = 4
        self.attention_head_size = 4
        self.initializer_range = 0.02
        self.attention_probs_dropout_prob = 0.1
        self.output_attentions = True

config = Config()

batch_size = 2
seq_length = 3
hidden_size = 16

hidden_states = tf.random.normal([batch_size, seq_length, hidden_size])
attention_mask = tf.ones([batch_size, seq_length])

ARGS = {
    'config': config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFFastSpeechSelfAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFFastSpeechSelfAttention 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
TFFastSpeechSelfOutput Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("6dec766f037f9f53")
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 an instance of its own class, TFFastSpeechSelfOutput: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

def get_initializer(initializer_range=0.02):
    """Creates a `tf.initializers.truncated_normal` with the given range.

    Args:
        initializer_range: float, initializer range for stddev.

    Returns:
        TruncatedNormal initializer with stddev = `initializer_range`.

    """
    return tf.keras.initializers.TruncatedNormal(stddev=initializer_range)

class TFFastSpeechSelfOutput(tf.keras.layers.Layer):
    """Fastspeech output of self attention module."""

    def __init__(self, config, **kwargs):
        """Init variables."""
        super().__init__(**kwargs)
        self.dense = tf.keras.layers.Dense(config.hidden_size, kernel_initializer=get_initializer(config.initializer_range), name='dense')
        self.LayerNorm = tf.keras.layers.LayerNormalization(epsilon=config.layer_norm_eps, name='LayerNorm')
        self.dropout = tf.keras.layers.Dropout(config.hidden_dropout_prob)

    def call(self, inputs, training=False):
        """Call logic."""
        hidden_states, input_tensor = inputs
        hidden_states = self.dense(hidden_states)
        hidden_states = self.dropout(hidden_states, training=training)
        hidden_states = self.LayerNorm(hidden_states + input_tensor)
        return hidden_states


class Config:
    def __init__(self):
        self.hidden_size = 4
        self.initializer_range = 0.02
        self.layer_norm_eps = 1e-5
        self.hidden_dropout_prob = 0.1


config = Config()

hidden_states = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))
input_tensor = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))

ARGS = {
    "config": config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFFastSpeechSelfOutput — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFFastSpeechSelfOutput 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
TFFastSpeechVariantPredictor Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("7a01e57ef50caff0")
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 an instance of its own class, TFFastSpeechVariantPredictor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf


class EncoderSelfAttentionParams:
    def __init__(self):
        self.hidden_size = 4


class MockConfig:
    def __init__(self):
        self.variant_prediction_num_conv_layers = 2
        self.variant_predictor_filter = 4
        self.variant_predictor_kernel_size = 3
        self.layer_norm_eps = 1e-5
        self.variant_predictor_dropout_rate = 0.1
        self.n_speakers = 2
        self.encoder_self_attention_params = EncoderSelfAttentionParams()
        self.initializer_range = 0.02


config = MockConfig()

# Create small test tensors
batch_size = 2
seq_length = 3
hidden_size = 4
n_speakers = 2

encoder_hidden_states = tf.random.normal([batch_size, seq_length, hidden_size])
speaker_ids = tf.constant([0, 1], dtype=tf.int32)
attention_mask = tf.ones([batch_size, seq_length], dtype=tf.int32)

inputs = (encoder_hidden_states, speaker_ids, attention_mask)

ARGS = {
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFFastSpeechVariantPredictor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFFastSpeechVariantPredictor 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
TFTacotronPostnet Ran
ran on a synthesized input · constructed an object; no result was computed
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("cdf85c2097858d3f")
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 an instance of its own class, TFTacotronPostnet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf

class Config:
    """Stand-in config class for Tacotron postnet."""
    def __init__(self):
        self.n_conv_postnet = 3
        self.postnet_conv_filters = 512
        self.num_mels = 80
        self.postnet_conv_kernel_sizes = 5
        self.postnet_dropout_rate = 0.1

config = Config()

batch_size = 2
seq_len = 10
num_mels = 80

outputs = tf.random.normal((batch_size, seq_len, num_mels))
mask = tf.ones((batch_size, seq_len), dtype=tf.float32)

inputs = (outputs, mask)

ARGS = {
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TFTacotronPostnet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TFTacotronPostnet 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
TextToTokens Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("21b9024092bb96f5")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

Tokenizer Ran
ran on a synthesized input
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("6e41883c2988e191")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

TransformerFFNLayer Ran
ran on a synthesized input · constructed an object; no result was computed
keonlee9420/Comprehensive-Transformer-TTS/model/transformers/transformer_fs2.py
code served (permissive licence) · get_code("30e52ae5f2331859")
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 an instance of its own class, TransformerFFNLayer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'hidden_size': 4,
    'filter_size': 8,
    'padding': 'SAME',
    'kernel_size': 1,
    'dropout': 0.1,
    'act': 'gelu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TransformerFFNLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransformerFFNLayer 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
VarianceEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
KevinMIN95/StyleSpeech/models/VarianceAdaptor.py
code served (permissive licence) · get_code("c928b9499fb7fae8")
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 an instance of its own class, VarianceEmbedding: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# VarianceEmbedding parameters:
# - input_size: int (number of input channels)
# - embed_size: int (embedding dimension)
# - kernel_size: int (convolution kernel size)
# - dropout: float (dropout rate)

ARGS = {
    "input_size": 4,
    "embed_size": 8,
    "kernel_size": 3,
    "dropout": 0.1,
}
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 VarianceEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VarianceEmbedding 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
VariancePredictor Ran
ran on a synthesized input · constructed an object; no result was computed
galaxycong/hpmdubbing/model/modules.py
code served (permissive licence) · get_code("4a7b9274be24e677")
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 an instance of its own class, VariancePredictor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from collections import OrderedDict

torch.manual_seed(0)

model_config = {
    'transformer': {
        'encoder_hidden': 4
    },
    'variance_predictor': {
        'filter_size': 8,
        'kernel_size': 3,
        'dropout': 0.1
    }
}

ARGS = {
    'model_config': model_config
}
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 VariancePredictor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VariancePredictor 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
VariancePredictor Ran
ran on a synthesized input · constructed an object; no result was computed
ndkgit339/fastspeech2-filled_pause_speech_synthesis/model/fastspeech2.py
code served (permissive licence) · get_code("5d55d1a8b50dfe0b")
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 an instance of its own class, VariancePredictor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from collections import OrderedDict

torch.manual_seed(0)

# Build a minimal model_config dict that satisfies the VariancePredictor's needs
model_config = {
    'transformer': {
        'encoder_hidden': 64  # input_size for VariancePredictor
    },
    'variance_predictor': {
        'filter_size': 32,    # conv filter output size
        'kernel_size': 3,     # kernel size for conv layers
        'dropout': 0.1        # dropout rate
    }
}

ARGS = {
    'model_config': model_config
}
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 VariancePredictor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VariancePredictor 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
VariancePredictor Ran
ran on a synthesized input
KevinMIN95/StyleSpeech/models/VarianceAdaptor.py
code served (permissive licence) · get_code("d230391d0ce5e7bb")
How it ran

Ran 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

# INIT_ARGS for VariancePredictor.__init__
INIT_ARGS = {
    'input_size': 8,
    'filter_size': 6,
    'kernel_size': 3,
    'output_size': 1,
    'n_layers': 2,
    'dropout': 0.5
}

# ARGS for VariancePredictor.forward
# x shape: (batch_size, seq_len, input_size)
# mask shape: (batch_size, seq_len) - boolean mask where True means positions to mask out
batch_size = 2
seq_len = 5
input_size = INIT_ARGS['input_size']

x = torch.randn(batch_size, seq_len, input_size)
mask = torch.zeros(batch_size, seq_len, dtype=torch.bool)
mask[0, 3:] = True  # mask out last 2 positions of first batch item

ARGS = {
    'x': x,
    'mask': mask
}
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)
clones Ran
ran; our contract draft was wrong, not the code
cadia-lvl/fastspeech2/modules.py
code served (permissive licence) · get_code("d2d810cddae9f875")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ModuleList. 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 copy

torch.manual_seed(0)

# Create a simple nn.Module to clone
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

module = SimpleModule()
N = 3

ARGS = {
    'module': module,
    'N': N
}
Setup block drafted by
a language model, Claude Sonnet 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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList output the recorded ndim 1 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
convert_pad_shape Ran
ran on a synthesized input
shivammehta25/BetterFastSpeech2/fs2/utils/model.py
code served (permissive licence) · get_code("ecfa879e1ca09709")
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, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - It takes pad_shape as input
# - It reverses pad_shape with [::-1]
# - It iterates through the reversed shape and flattens it
# - pad_shape should be a list of lists (or similar nested structure)

# Create a valid pad_shape argument
# This represents padding specifications, typically a list of (pad_before, pad_after) tuples for each dimension
pad_shape = [
    (1, 2),      # dimension 0: pad 1 before, 2 after
    (3, 4),      # dimension 1: pad 3 before, 4 after
    (5, 6)       # dimension 2: pad 5 before, 6 after
]

ARGS = {
    "pad_shape": pad_shape
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_encoder_padding_mask Ran
ran, honoured the contract we drafted
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("db55b6a434821c7d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

create_mel_padding_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tartunlp/transformertts/src/transformer_tts/model/forward_model.py
pointer only (licence: NOASSERTION) · get_code("9975ceb350d936d5")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, tartunlp/transformertts (NOASSERTION). 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. A run is recorded.

discriminator_loss Ran
ran; our contract draft was wrong, not the code
shivammehta25/BetterFastSpeech2/fs2/hifigan/models.py
pointer only (licence: MIT); the stored copy get_code serves, from zjzser/wmcodec, is pointer only (licence: NONE) · get_code("7137577cbef51217")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zjzser/wmcodec, and GitHub detected no licence in that repository when it was checked. 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. A run is recorded.

dynamic_range_compression Ran
ran, violated the contract we drafted
shivammehta25/BetterFastSpeech2/fs2/hifigan/meldataset.py
code served (permissive licence) · get_code("be031b15a988a556")
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 1, dtype family float, shape (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

# Construct a small numpy array as input
x = np.array([0.00001, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0])

# Define arguments dict with all parameters
ARGS = {
    "x": x,
    "C": 1,
    "clip_val": 1e-05
}
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 ndarray, ndim 1, dtype family float, shape (8,) — shape (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
dynamic_range_decompression Ran
ran, violated the contract we drafted
shivammehta25/BetterFastSpeech2/fs2/hifigan/meldataset.py
code served (permissive licence) · get_code("9e30e7d510c9d341")
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 1, dtype family float, shape (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 numpy as np

# The function takes two parameters: x and C
# x is expected to be a numpy array (based on np.exp(x) operation)
# C is a scalar value used for division (default is 1)

# Create a small numpy array for x
x = np.array([0.5, 1.0, 1.5, 2.0])

# Create a scalar value for C
C = 2.0

ARGS = {
    "x": x,
    "C": C
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
evaluate Ran
ran on a synthesized input
rishikksh20/FastSpeech2/evaluation.py
code served (permissive licence) · get_code("644e4bb8a34cbee8")
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 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def _forward(self, x, ilens, out_length, dur, es, ps, is_inference=False):
        # x: [batch, seq_len, dim]
        # Return: (dummy, after_outs, d_outs, e_outs, p_outs)
        batch_size = x.shape[0]
        max_out_len = out_length.max().item() if out_length.numel() > 0 else 5
        
        after_outs = torch.randn(batch_size, max_out_len, 4)
        d_outs = dur.float()
        e_outs = es.float()
        p_outs = ps.float()
        
        return None, after_outs, d_outs, e_outs, p_outs

class DummyConfig:
    def __init__(self):
        self.data = type('obj', (object,), {
            'wav_dir': '/tmp/wavs/',
            'data_dir': '/tmp/data/'
        })()
        self.audio = type('obj', (object,), {
            'sample_rate': 22050
        })()

# Build a minimal valid batch
# valid = (x_, input_length_, y_, _, out_length_, ids_, dur_, e_, p_)
def create_batch():
    batch_size = 2
    seq_len = 5
    dim = 4
    
    x_ = torch.randn(batch_size, seq_len, dim)
    input_length_ = torch.tensor([seq_len, seq_len], dtype=torch.long)
    y_ = torch.randn(batch_size, seq_len, dim)
    _ = None  # placeholder
    out_length_ = torch.tensor([seq_len, seq_len], dtype=torch.long)
    ids_ = ["id_0", "id_1"]
    dur_ = torch.randn(batch_size, seq_len)
    e_ = torch.randn(batch_size, seq_len)
    p_ = torch.randn(batch_size, seq_len)
    
    return (x_, input_length_, y_, _, out_length_, ids_, dur_, e_, p_)

# Create validloader with 2 batches
validloader = [create_batch(), create_batch()]

# Create model
model = DummyModel()

# Create hyperparameter config
hp = DummyConfig()

ARGS = {
    "hp": hp,
    "validloader": validloader,
    "model": model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family 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
feature_loss Ran
ran, honoured the contract we drafted
shivammehta25/BetterFastSpeech2/fs2/hifigan/models.py
pointer only (licence: MIT); the stored copy get_code serves, from zjzser/wmcodec, is pointer only (licence: NONE) · get_code("e453b51f0ed5fb28")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zjzser/wmcodec, and GitHub detected no licence in that repository when it was checked. 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. A run is recorded.

gelu Ran
ran, honoured the contract we drafted
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("7013e9a8259233a5")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

def gelu(x):
    """Gaussian Error Linear unit."""
    cdf = 0.5 * (1.0 + tf.math.erf(x / tf.math.sqrt(2.0)))
    return x * cdf

# Create a small TensorFlow tensor
x_np = np.random.randn(2, 4).astype(np.float32)
x = tf.convert_to_tensor(x_np)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
gelu_new Ran
ran, honoured the contract we drafted
dathudeptrai/TensorflowTTS/tensorflow_tts/models/fastspeech2.py
code served (permissive licence) · get_code("f6c9754063b07733")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

# Create a small tensor to pass to gelu_new
x = tf.constant(np.random.randn(2, 4).astype(np.float32))

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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

Showing the first 60. An agent gets every one from get_harvested_code_for_paper("2006.04558").

Also present in other papers' code

Of 119 samples lifted from this paper's linked repositories, 119 carry a function identity and 0 do not. Of the 115 distinct functions with an identity, 29 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 7 the same month, 27 later) and 86 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
clones 79 other papers
20 dated earlier, 3 the same month, 56 later · 11 only as an assembly brick
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1612.00563 (2016-12)
Self-critical Sequence Training for Image Captioning
1706.03762 (2017-06)
Attention Is All You Need
and 76 more not named here
get_padding 53 other papers
1 dated earlier, 1 the same month, 50 later, 1 undated · 4 only as an assembly brick
1910.10838 (2019-10)
Zero-Shot Multi-Speaker Text-To-Speech with State-of-the-art Neural Speaker Embeddings
2006.06873 (2020-06)
FastPitch: Parallel Text-to-speech with Pitch Prediction
2010.05646 (2020-10)
HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis
and 50 more not named here
feature_loss 15 other papers
15 later
2106.06103 (2021-06)
Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech
2106.07889 (2021-06)
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
2109.13821 (2021-09)
Diffusion-Based Voice Conversion with Fast Maximum Likelihood Sampling Scheme
and 12 more not named here
discriminator_loss 13 other papers
13 later
2106.07889 (2021-06)
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
2109.13821 (2021-09)
Diffusion-Based Voice Conversion with Fast Maximum Likelihood Sampling Scheme
2203.02395 (2022-03)
iSTFTNet: Fast and Lightweight Mel-Spectrogram Vocoder Incorporating Inverse Short-Time Fourier Transform
and 10 more not named here
dynamic_range_compression 13 other papers
13 later
2106.07889 (2021-06)
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
2110.12676 (2021-10)
Controllable and Interpretable Singing Voice Decomposition via Assem-VC
2202.13277 (2022-02)
Learning the Beauty in Songs: Neural Singing Voice Beautifier
and 10 more not named here
dynamic_range_decompression 13 other papers
13 later
2106.07889 (2021-06)
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
2110.12676 (2021-10)
Controllable and Interpretable Singing Voice Decomposition via Assem-VC
2202.13277 (2022-02)
Learning the Beauty in Songs: Neural Singing Voice Beautifier
and 10 more not named here
generator_loss 13 other papers
13 later
2106.06103 (2021-06)
Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech
2106.07889 (2021-06)
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
2109.13821 (2021-09)
Diffusion-Based Voice Conversion with Fast Maximum Likelihood Sampling Scheme
and 10 more not named here
get_sinusoid_encoding_table
brick of this paper's assembly: helper
12 other papers
4 dated earlier, 1 the same month, 6 later, 1 same year, order not determinable · 2 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1910.02481 (2019-10)
Learn to Explain Efficiently via Neural Logic Inductive Learning
and 9 more not named here
read_lexicon 11 other papers
1 dated earlier, 1 the same month, 9 later
1905.09263 (2019-05)
FastSpeech: Fast, Robust and Controllable Text to Speech
2006.06873 (2020-06)
FastPitch: Parallel Text-to-speech with Pitch Prediction
2009.00713 (2020-09)
WaveGrad: Estimating Gradients for Waveform Generation
and 8 more not named here
load_wav 9 other papers
9 later
2106.07889 (2021-06)
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
2110.12676 (2021-10)
Controllable and Interpretable Singing Voice Decomposition via Assem-VC
2202.13277 (2022-02)
Learning the Beauty in Songs: Neural Singing Voice Beautifier
and 6 more not named here
plot_spectrogram 7 other papers
7 later
2106.07889 (2021-06)
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
2203.02395 (2022-03)
iSTFTNet: Fast and Lightweight Mel-Spectrogram Vocoder Incorporating Inverse Short-Time Fourier Transform
2203.13086 (2022-03)
HiFi++: a Unified Framework for Bandwidth Extension and Speech Enhancement
and 4 more not named here
sequence_mask 7 other papers
7 later
2106.06103 (2021-06)
Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech
2109.15166 (2021-09)
PortaSpeech: Portable and High-Quality Generative Text-to-Speech
2204.11792 (2022-04)
SyntaSpeech: Syntax-Aware Generative Adversarial Text-to-Speech
and 4 more not named here
gelu
brick of this paper's assembly: helper
6 other papers
2 dated earlier, 1 the same month, 3 later · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1910.01108 (2019-10)
DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
2006.04884 (2020-06)
On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines
and 3 more not named here
gelu_new
brick of this paper's assembly: helper
6 other papers
2 dated earlier, 1 the same month, 3 later · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1910.01108 (2019-10)
DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
2006.04884 (2020-06)
On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines
and 3 more not named here
get_initializer
brick of this paper's assembly: helper
6 other papers
5 dated earlier, 1 the same month · 1 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1909.05017 (2019-09)
Question Generation by Transformers
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
and 3 more not named here
process_paragraph 3 other papers
1 dated earlier, 2 later
1905.09263 (2019-05)
FastSpeech: Fast, Robust and Controllable Text to Speech
2102.04040 (2021-02)
LightSpeech: Lightweight and Fast Text to Speech with Neural Architecture Search
2104.09715 (2021-04)
AdaSpeech 2: Adaptive Text to Speech with Untranscribed Data
Conv
brick of this paper's assembly: helper, model
1 other paper
1 later · 1 only as an assembly brick
2103.00993 (2021-03)
AdaSpeech: Adaptive Text to Speech for Custom Voice
ConvNorm
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2305.11094 (2023-05)
QPGesture: Quantization-Based and Phase-Guided Motion Matching for Natural Speech-Driven Gesture Generation
LayerNorm
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2202.13277 (2022-02)
Learning the Beauty in Songs: Neural Singing Voice Beautifier
LengthRegulator
brick of this paper's assembly: helper, model
1 other paper
1 later
2103.00993 (2021-03)
AdaSpeech: Adaptive Text to Speech for Custom Voice

Shown: the 20 functions present in the most other papers. 9 more shared functions are not listed here.

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-21.

Repositories linked to this paper

More are linked than shown here.

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

Abstract

Non-autoregressive text to speech (TTS) models such as FastSpeech (Ren et al., 2019) can synthesize speech significantly faster than previous autoregressive models with comparable quality. The training of FastSpeech model relies on an autoregressive teacher model for duration prediction (to provide more information as input) and knowledge distillation (to simplify the data distribution in output), which can ease the one-to-many mapping problem (i.e., multiple speech variations correspond to the same text) in TTS. However, FastSpeech has several disadvantages: 1) the teacher-student distillation pipeline is complicated and time-consuming, 2) the duration extracted from the teacher model is not accurate enough, and the target mel-spectrograms distilled from teacher model suffer from information loss due to data simplification, both of which limit the voice quality. In this paper, we propose FastSpeech 2, which addresses the issues in FastSpeech and better solves the one-to-many mapping problem in TTS by 1) directly training the model with ground-truth target instead of the simplified output from teacher, and 2) introducing more variation information of speech (e.g., pitch, energy and more accurate duration) as conditional inputs. Specifically, we extract duration, pitch and energy from speech waveform and directly take them as conditional inputs in training and use predicted values in inference. We further design FastSpeech 2s, which is the first attempt to directly generate speech waveform from text in parallel, enjoying the benefit of fully end-to-end inference. Experimental results show that 1) FastSpeech 2 achieves a 3x training speed-up over FastSpeech, and FastSpeech 2s enjoys even faster inference speed; 2) FastSpeech 2 and 2s outperform FastSpeech in voice quality, and Fast-Speech 2 can even surpass autoregressive models. Audio samples are available at https://speechresearch.github.io/fastspeech2/.

For agents

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

get_harvested_code_for_paper("2006.04558")
get_code_for_paper("2006.04558")
have("2006.04558")

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

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

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

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

Connect an agent — have() is free.