【NPU】fix bug of using temp vector (#31963)

ascendrc
Leo Chen 4 years ago committed by GitHub
parent a6343afc70
commit bc7a3afa68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -65,7 +65,8 @@ class FillConstantNPUKernel : public framework::OpKernel<T> {
Tensor tensor_tmp(data_type);
tensor_tmp.mutable_data<T>({1}, ctx.GetPlace());
TensorFromVector(std::vector<T>{value}, ctx.device_context(), &tensor_tmp);
std::vector<T> init = {value};
TensorFromVector(init, ctx.device_context(), &tensor_tmp);
out_var->mutable_data<T>(shape, place);
auto runner = NpuOpRunner("FillD", {tensor_tmp}, {*out_var},

Loading…
Cancel
Save