diff --git a/paddle/fluid/pir/dialect/operator/ir/ops.yaml b/paddle/fluid/pir/dialect/operator/ir/ops.yaml index bf80652d03134..faa6b64ee2ee9 100644 --- a/paddle/fluid/pir/dialect/operator/ir/ops.yaml +++ b/paddle/fluid/pir/dialect/operator/ir/ops.yaml @@ -163,6 +163,13 @@ args : (Tensor[] x, bool[] share_dims_and_dtype = {}) output : Tensor[](out){x.size()}, Tensor[](xout){x.size()} +- op : share_data + args : (Tensor x) + output : Tensor(out) + kernel: + func: share_data + param: [x] + - op : write_to_array args : (Tensor i, Tensor x) output : Tensor[](out) diff --git a/paddle/fluid/pir/dialect/operator/utils/utils.cc b/paddle/fluid/pir/dialect/operator/utils/utils.cc index 4681b9b100122..29e2d7daf0ebe 100644 --- a/paddle/fluid/pir/dialect/operator/utils/utils.cc +++ b/paddle/fluid/pir/dialect/operator/utils/utils.cc @@ -34,7 +34,8 @@ const std::unordered_set LegacyOpList = { "pd_op.c_reduce_sum_", "pd_op.c_allreduce_max_", "pd_op.c_allgather", - "pd_op.seed"}; + "pd_op.seed", + "pd_op.share_data"}; enum class AttrType { UNDEFINED = 0, diff --git a/paddle/phi/api/yaml/op_compat.yaml b/paddle/phi/api/yaml/op_compat.yaml index 9d499c68bef74..160e1abd29afb 100755 --- a/paddle/phi/api/yaml/op_compat.yaml +++ b/paddle/phi/api/yaml/op_compat.yaml @@ -3190,6 +3190,12 @@ data_type : int64_t tensors_name : StepsTensorList +- op: share_data + inputs : + x : X + outputs : + out : Out + - op: sigmoid_cross_entropy_with_logits backward: sigmoid_cross_entropy_with_logits_grad inputs :