MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / hasContiguousSubspace

Function hasContiguousSubspace

paddle/phi/kernels/funcs/stride_utils.h:553–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553static 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

Callers 1

makeLinearIndexFunction · 0.85

Calls 6

baseMethod · 0.80
initializedMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
rbeginMethod · 0.45
rendMethod · 0.45

Tested by

no test coverage detected