Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add float16 for assign_value #56170

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/phi/api/yaml/static_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
backward : assign_grad

- op : assign_value
args : (int[] shape, DataType dtype, int[] bool_values = {}, float[] fp32_values = {}, int[] int32_values = {}, int64_t[] int64_values = {})
args : (int[] shape, DataType dtype, int[] bool_values = {}, float[] fp16_values = {}, float[] fp32_values = {}, int[] int32_values = {}, int64_t[] int64_values = {})
output : Tensor(out)
infer_meta :
func : AssignValueInferMeta
Expand Down
1 change: 1 addition & 0 deletions paddle/phi/kernels/assign_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ PD_REGISTER_KERNEL(assign_value,
ALL_LAYOUT,
phi::AssignValueKernel,
bool,
phi::dtype::float16,
int,
float,
int8_t,
Expand Down
3 changes: 3 additions & 0 deletions paddle/phi/ops/compat/assign_value_sig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ KernelSignature AssignValueOpArgumentMapping(
} else if (dtype == /*INT64*/ 3) {
return KernelSignature(
"assign_value", {}, {"shape", "dtype", "int64_values"}, {"Out"});
} else if (dtype == DataType::FLOAT16) {
Liyulingyue marked this conversation as resolved.
Show resolved Hide resolved
return KernelSignature(
"assign_value", {}, {"shape", "dtype", "fp16_values"}, {"Out"});
Liyulingyue marked this conversation as resolved.
Show resolved Hide resolved
} else {
return KernelSignature("unregistered", {}, {}, {});
}
Expand Down