File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ class IterableDatasetWrapper {
140140 }
141141
142142 for (size_t j = 0 ; j < slots_.size (); ++j) {
143- if (!IsValidLoDTensor (*tensors_[i][j])) {
143+ if (!IsValidDenseTensor (*tensors_[i][j])) {
144144 is_success = false ;
145145 break ;
146146 }
@@ -176,19 +176,9 @@ class IterableDatasetWrapper {
176176 }
177177
178178 private:
179- bool IsValidLoDTensor (const phi::DenseTensor &tensor) const {
180- auto &lod = tensor.lod ();
181- PADDLE_ENFORCE_LE (
182- lod.size (),
183- 1 ,
184- common::errors::InvalidArgument (" LoD level must be not larger than 1" ));
179+ bool IsValidDenseTensor (const phi::DenseTensor &tensor) const {
185180 if (!drop_last_) return true ;
186-
187- if (lod.empty ()) {
188- return static_cast <size_t >(tensor.dims ()[0 ]) == batch_size_;
189- } else {
190- return lod[0 ].size () == batch_size_ + 1 ;
191- }
181+ return static_cast <size_t >(tensor.dims ()[0 ]) == batch_size_;
192182 }
193183
194184 private:
You can’t perform that action at this time.
0 commit comments