From 892f6850583d830e45d165c814daf622056c1c6c Mon Sep 17 00:00:00 2001 From: Aganlengzi Date: Thu, 19 May 2022 14:20:51 +0800 Subject: [PATCH] [NPU] minor changes for version control to support version without suffix (#42856) --- paddle/fluid/operators/fill_constant_op_npu.cc | 2 +- paddle/fluid/operators/set_value_op_npu.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/fill_constant_op_npu.cc b/paddle/fluid/operators/fill_constant_op_npu.cc index cb03add3143..edd8613ba52 100644 --- a/paddle/fluid/operators/fill_constant_op_npu.cc +++ b/paddle/fluid/operators/fill_constant_op_npu.cc @@ -65,7 +65,7 @@ class FillConstantNPUKernel : public framework::OpKernel { tensor_value.mutable_data({1}, ctx.GetPlace()); FillNpuTensorWithConstant(&tensor_value, value); NpuOpRunner runner; -#if (CANN_VERSION_CODE >= 503003 && CANN_VERSION_CODE < 504001) +#if (CANN_VERSION_CODE >= 503003 && CANN_VERSION_CODE < 504000) runner.SetType("FillD") .AddInput(tensor_value) .AddOutput(*out_var) diff --git a/paddle/fluid/operators/set_value_op_npu.cc b/paddle/fluid/operators/set_value_op_npu.cc index c22e07583df..daa033f9dc6 100644 --- a/paddle/fluid/operators/set_value_op_npu.cc +++ b/paddle/fluid/operators/set_value_op_npu.cc @@ -178,7 +178,7 @@ class SetValueNPUKernel : public framework::OpKernel { .AddInput(std::move(index_indices)) .AddInput(val_temp) .AddOutput(out_temp) -#if (CANN_VERSION_CODE >= 504001) +#if (CANN_VERSION_CODE >= 504000) .AddAttrs({{"use_locking", false}}) #endif .Run(stream); -- GitLab