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

Function CreateKernelDistOutput

paddle/phi/api/lib/api_gen_utils.cc:735–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733}
734
735std::shared_ptr<phi::distributed::DistTensor> CreateKernelDistOutput(
736 Tensor* out,
737 bool set_dist_output_as_tensor_impl,
738 const phi::distributed::TensorDistAttr& dist_attr) {
739 if (out) {
740 auto dist_output =
741 std::make_shared<phi::distributed::DistTensor>(phi::DDim(), dist_attr);
742 if (set_dist_output_as_tensor_impl) {
743 VLOG(3) << "CreateKernelDistOutput function set generated output "
744 "dist_tensor as Tensor's impl";
745 if (out->is_dist_tensor()) {
746 VLOG(3) << "out is DistTensor, set DistAttr:" << dist_attr
747 << " to generated DistOutput.";
748 dist_output->unsafe_set_dist_attr(dist_attr);
749 }
750 out->set_impl(dist_output);
751 }
752 return dist_output;
753 }
754 VLOG(4) << "CreateKernelDistOutput with NULL out";
755 return nullptr;
756}
757
758std::shared_ptr<phi::distributed::DistTensor> CreateKernelDistOutput(
759 Tensor* out,

Callers 1

embedding_grad_implFunction · 0.85

Calls 8

PADDLE_GET_CONSTFunction · 0.85
is_dist_tensorMethod · 0.80
unsafe_set_dist_attrMethod · 0.80
set_implMethod · 0.80
DDimClass · 0.50
sizeMethod · 0.45
reserveMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected