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

Function DealWithStride

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

Source from the content-addressed store, hash-verified

31}
32
33inline void DealWithStride(const DenseTensorIterator& iter, int64_t* strides) {
34 for (int dim = 0; dim < iter.ndim(); dim++) {
35 for (int arg = 0; arg < iter.ntensors(); arg++) {
36 *strides++ = iter.strides(arg)[dim];
37 }
38 }
39 if (iter.ndim() < 2) {
40 std::fill_n(strides, (2 - iter.ndim()) * iter.ntensors(), 0);
41 }
42}
43
44template <typename T>
45inline void FallbackContiguous(const DDim& input_dims,

Callers 1

ContiguousKernelFunction · 0.85

Calls 3

ntensorsMethod · 0.80
ndimMethod · 0.45
stridesMethod · 0.45

Tested by

no test coverage detected