diff --git a/python/paddle/fluid/data_feeder.py b/python/paddle/fluid/data_feeder.py index 631bbfe1fe59ddd9cd315fb64ca32e1e125b0e8d..5102a558fd3fdfd89ad769cd3a10f5dc3ea78716 100644 --- a/python/paddle/fluid/data_feeder.py +++ b/python/paddle/fluid/data_feeder.py @@ -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)