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

Function NeedTransformLayout

paddle/phi/api/lib/data_transform.cc:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50inline bool NeedTransformLayout(const DataLayout& input,
51 const DataLayout& target,
52 const phi::Place& place,
53 const TransformFlag& transform_flag) {
54 if (FLAGS_use_stride_kernel && target == DataLayout::STRIDED) {
55 return false;
56 }
57
58 bool ret = transform_flag.need_trans_layout() &&
59 (input != DataLayout::ALL_LAYOUT &&
60 target != DataLayout::ALL_LAYOUT && input != target);
61 if (place.GetType() == phi::AllocationType::GPU) {
62 return false;
63 }
64 return ret;
65}
66
67inline bool NeedTransform2Contiguous(bool is_stride_kernel,
68 bool is_contiguous) {

Callers 3

TransformDataFunction · 0.70
PrepareDataFunction · 0.70
PrepareDataForDistTensorFunction · 0.70

Calls 2

need_trans_layoutMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected