- Implemented core model components in `modules.py` including various convolutional layers and normalization techniques. - Added transformation functions in `transforms.py` for piecewise rational quadratic transformations. - Created utility functions in `utils.py` for checkpoint management, logging, and hyperparameter handling. - Introduced monotonic alignment functionality with Cython optimization in `monotonic_align`. - Developed a minimal inference server in `server.py` to handle synthesis requests. - Updated requirements to include necessary dependencies for Cython and scipy.
32 lines
709 B
Go
32 lines
709 B
Go
package domain
|
|
|
|
import "testing"
|
|
|
|
func TestIntersperse(t *testing.T) {
|
|
got := Intersperse([]int64{1, 2, 3}, 0)
|
|
want := []int64{0, 1, 0, 2, 0, 3, 0}
|
|
if len(got) != len(want) {
|
|
t.Fatalf("Intersperse() = %v, want %v", got, want)
|
|
}
|
|
for i := range want {
|
|
if got[i] != want[i] {
|
|
t.Fatalf("Intersperse() = %v, want %v", got, want)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestSymbolToIDCoversLetters(t *testing.T) {
|
|
for _, r := range "ABCabc012" {
|
|
if _, ok := SymbolToID[r]; !ok {
|
|
t.Errorf("SymbolToID missing letter/digit %q", r)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestSymbolToIDPad(t *testing.T) {
|
|
id, ok := SymbolToID['_']
|
|
if !ok || id != 0 {
|
|
t.Fatalf("SymbolToID['_'] = (%d, %v), want (0, true) - pad must be symbol ID 0", id, ok)
|
|
}
|
|
}
|