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

Function MakePhiIntArrayFromVar

paddle/fluid/framework/phi_utils.cc:293–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293phi::IntArray MakePhiIntArrayFromVar(const framework::Variable& variable) {
294 if (variable.IsType<DenseTensor>()) {
295 const auto& tensor = variable.Get<DenseTensor>();
296 return phi::IntArray(tensor);
297 } else {
298 PADDLE_THROW(common::errors::Unimplemented(
299 "Unsupported casting input `%s` type to IntArray when call pt "
300 "kernel.",
301 framework::ToTypeName(variable.Type())));
302 }
303}
304
305// TODO(chentianyu03): Inplace with IntArray constructor
306phi::IntArray MakePhiIntArrayFromVarList(

Callers 3

BuildInferMetaContextFunction · 0.85
BuildPhiKernelContextMethod · 0.85

Calls 3

IntArrayClass · 0.85
ToTypeNameFunction · 0.85
TypeMethod · 0.45

Tested by

no test coverage detected