未验证 提交 ebf2f539 编写于 作者: L Li Fuchen 提交者: GitHub

Merge pull request #403 from lfchener/fix_dim

fix the text_data dim to fit the dim check in paddle develop version
...@@ -330,11 +330,10 @@ class DataGenerator(object): ...@@ -330,11 +330,10 @@ class DataGenerator(object):
axis=0) axis=0)
masks.append(mask) masks.append(mask)
padded_audios = np.array(padded_audios).astype('float32') padded_audios = np.array(padded_audios).astype('float32')
texts = np.expand_dims(np.array(texts).astype('int32'), axis=-1)
if self._is_training: if self._is_training:
texts = fluid.create_lod_tensor( texts = fluid.create_lod_tensor(
np.array(texts).astype('int32'), texts, recursive_seq_lens=[text_lens], place=self._place)
recursive_seq_lens=[text_lens],
place=self._place)
audio_lens = np.array(audio_lens).astype('int64').reshape([-1, 1]) audio_lens = np.array(audio_lens).astype('int64').reshape([-1, 1])
masks = np.array(masks).astype('float32') masks = np.array(masks).astype('float32')
return padded_audios, texts, audio_lens, masks return padded_audios, texts, audio_lens, masks
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册