def test_get_item_at_start_of_utterance(self, sample_partition_data): frame_data = iterator.MultiFramePartitionData(sample_partition_data, 3, shuffle=False) assert len(frame_data[2]) == 2 assert np.array_equal(frame_data[2][0], np.arange(12).reshape(3, 4)) assert np.array_equal(frame_data[2][1], np.arange(12).reshape(3, 4) + 10)
def test_get_utt_regions(self, sample_partition_data): frame_data = iterator.MultiFramePartitionData(sample_partition_data, 3, shuffle=False) regions = frame_data.get_utt_regions() assert regions[0][0] == 0 assert regions[0][1] == 2 assert regions[1][0] == 2 assert regions[1][1] == 3 assert regions[2][0] == 5 assert regions[2][1] == 3 assert regions[3][0] == 8 assert regions[3][1] == 1 assert regions[4][0] == 9 assert regions[4][1] == 2
def test_get_length(self, sample_partition_data): frame_data = iterator.MultiFramePartitionData(sample_partition_data, 3, shuffle=False) assert len(frame_data) == 11