未验证 提交 2bb8f5b1 编写于 作者: Q qingqing01 提交者: GitHub

Support variable data shape of non-sequence data. (#13482)

上级 8a8c5726
......@@ -71,7 +71,7 @@ class DataToLoDTensorConverter(object):
def done(self):
arr = numpy.array(self.data, dtype=self.dtype)
if self.shape:
if self.shape and len(arr.shape) != len(self.shape):
arr = arr.reshape(self.shape)
t = core.LoDTensor()
t.set(arr, self.place)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册