| 733 | } |
| 734 | |
| 735 | std::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 | |
| 758 | std::shared_ptr<phi::distributed::DistTensor> CreateKernelDistOutput( |
| 759 | Tensor* out, |
no test coverage detected