| 551 | } |
| 552 | |
| 553 | static inline bool hasContiguousSubspace(const std::vector<DenseTensor>& tl) { |
| 554 | auto isDefined = [](const DenseTensor& tensor) { |
| 555 | return tensor.initialized(); |
| 556 | }; |
| 557 | auto isNull = [](const DenseTensor& tensor) { return !tensor.initialized(); }; |
| 558 | |
| 559 | auto start = std::find_if(tl.begin(), tl.end(), isDefined); |
| 560 | auto stop = std::find_if(tl.rbegin(), tl.rend(), isDefined); |
| 561 | auto it = std::find_if(start, stop.base(), isNull); |
| 562 | return it == stop.base(); |
| 563 | } |
| 564 | |
| 565 | #if defined(PADDLE_WITH_CUDA) |
| 566 |
no test coverage detected