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

Function TransDataLayout

paddle/fluid/framework/data_layout_transform.cc:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void TransDataLayout(const phi::KernelKey& kernel_type_for_var,
54 const phi::KernelKey& expected_kernel_type,
55 const phi::DenseTensor& in,
56 phi::DenseTensor* out,
57 const phi::Place& place) {
58 PADDLE_ENFORCE(
59 backends_are_same_class(kernel_type_for_var.backend(),
60 expected_kernel_type.backend()),
61 common::errors::PreconditionNotMet(
62 "TransDataLayout only support DataLayout transform on same place."));
63
64 TransDataLayout(kernel_type_for_var.layout(),
65 expected_kernel_type.layout(),
66 place,
67 in,
68 out);
69}
70
71void TransDataLayout(DataLayout from_layout,
72 DataLayout to_layout,

Callers 3

TransformDataFunction · 0.70
ApplyImplMethod · 0.50
ApplyImplMethod · 0.50

Calls 15

backends_are_same_classFunction · 0.85
arityFunction · 0.85
InstanceFunction · 0.85
make_ddimFunction · 0.85
GetAxisFunction · 0.70
VisitDataTypeFunction · 0.70
TransToProtoVarTypeFunction · 0.70
CastDataLayoutClass · 0.70
backendMethod · 0.45
layoutMethod · 0.45
dimsMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected