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

Function FastContiguousJudge

paddle/phi/kernels/cpu/contiguous_kernel.cc:108–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108inline bool FastContiguousJudge(const std::vector<int64_t>& coalesce_shape,
109 const DenseTensor& input) {
110 if (coalesce_shape.size() > 3 || input.dims().size() == 0) return false;
111 auto x_meta = input.meta();
112 if (coalesce_shape.size() == 3 &&
113 !OnlyTransposed(x_meta.dims, x_meta.strides, x_meta.offset))
114 return false;
115 return true;
116}
117
118inline bool FastTransposeCopyValid(const DenseTensor& self,
119 const DenseTensor& src) {

Callers 1

ContiguousKernelFunction · 0.85

Calls 4

OnlyTransposedFunction · 0.85
metaMethod · 0.80
sizeMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected