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

upload-readme
qingqing01 7 years ago committed by GitHub
parent 8a8c57267a
commit 2bb8f5b1b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save