示例#1
0
def test_iterate_seqs_no_chunking_1():
    dataset = DummyDataset(input_dim=2, output_dim=3, num_seqs=2, seq_len=11)
    dataset.init_seq_order(1)
    seqs = list(
        dataset.iterate_seqs(chunk_size=0, chunk_step=0, used_data_keys=None))
    assert_equal(len(seqs), 2)
    assert_equal(seqs[0], (0, 0, 11))  # seq-idx, start-frame, end-frame
    assert_equal(seqs[1], (1, 0, 11))
示例#2
0
def test_iterate_seqs_chunking_1():
    dataset = DummyDataset(input_dim=2, output_dim=3, num_seqs=2, seq_len=11)
    dataset.init_seq_order(1)
    seqs = list(
        dataset.iterate_seqs(chunk_size=10, chunk_step=5, used_data_keys=None))
    for s in seqs:
        print(s)
    assert_equal(len(seqs), 6)
    assert_equal(seqs[0], (0, 0, 10))  # seq-idx, start-frame, end-frame
    assert_equal(seqs[1], (0, 5, 11))
    assert_equal(seqs[2], (0, 10, 11))
    assert_equal(seqs[3], (1, 0, 10))
    assert_equal(seqs[4], (1, 5, 11))
    assert_equal(seqs[5], (1, 10, 11))