Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions paddle/fluid/pir/dialect/operator/ir/manual_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ void set_parameter(const pir::Value& parameter, const std::string& name) {
}
}

void updata_parameter(const pir::Value& parameter, const std::string& name) {
void update_parameter(const pir::Value& parameter, const std::string& name) {
pir::Parameter* param = ApiBuilder::Instance().GetParameter(name);
PADDLE_ENFORCE_NOT_NULL(param,
phi::errors::InvalidArgument(
"Parameter %s not exist, can not updata.", name));
"Parameter %s not exist, can not update.", name));
std::unique_ptr<pir::Parameter> param_new(
new pir::Parameter(nullptr, 0, parameter.type()));
ApiBuilder::Instance().SetParameter(name, std::move(param_new));
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/pir/dialect/operator/ir/manual_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pir::Value parameter(const std::string& name);

void set_parameter(const pir::Value& parameter, const std::string& name);

void updata_parameter(const pir::Value& parameter, const std::string& name);
void update_parameter(const pir::Value& parameter, const std::string& name);

void shadow_output(const pir::Value& persist_value, const std::string& name);

Expand Down
10 changes: 5 additions & 5 deletions paddle/fluid/pybind/manual_static_op_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static PyObject *static_api_set_parameter(PyObject *self,
}
}

static PyObject *static_api_updata_parameter(PyObject *self,
static PyObject *static_api_update_parameter(PyObject *self,
PyObject *args,
PyObject *kwargs) {
try {
Expand All @@ -98,7 +98,7 @@ static PyObject *static_api_updata_parameter(PyObject *self,
// Call ir static api
CallStackRecorder callstack_recoder("uodata_parameter");
callstack_recoder.Record();
paddle::dialect::updata_parameter(parameter, name);
paddle::dialect::update_parameter(parameter, name);
callstack_recoder.AttachToOps();
Py_RETURN_NONE;
} catch (...) {
Expand Down Expand Up @@ -975,10 +975,10 @@ static PyMethodDef ManualOpsAPI[] = {
(PyCFunction)(void (*)(void))static_api_set_parameter,
METH_VARARGS | METH_KEYWORDS,
"C++ interface function for set_parameter."},
{"updata_parameter",
(PyCFunction)(void (*)(void))static_api_updata_parameter,
{"update_parameter",
(PyCFunction)(void (*)(void))static_api_update_parameter,
METH_VARARGS | METH_KEYWORDS,
"C++ interface function for updata_parameter."},
"C++ interface function for update_parameter."},
{"set_persistable_value",
(PyCFunction)(void (*)(void))static_api_set_persistable_value,
METH_VARARGS | METH_KEYWORDS,
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/amp/auto_cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def _pir_transform(t, dtype):
param = op.operand(0).source()
cast_param = paddle.cast(param, dtype)
cast_param.persistable = True
paddle._pir_ops.updata_parameter(cast_param, t.name)
paddle._pir_ops.update_parameter(cast_param, t.name)
block.remove_op(op)
break
main.set_parameters_from(startup)
Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_lstm_cudnn_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RandomWeight:
def __init__(self):
pass

def updata_weight(self, hidden_size, input_size, dtype):
def update_weight(self, hidden_size, input_size, dtype):
std = 1.0 / math.sqrt(hidden_size)
self.hidden_size = hidden_size
self.input_size = input_size
Expand Down Expand Up @@ -432,7 +432,7 @@ def setUp(self):
input[9][3:][:] = 0
input[8][4:][:] = 0

weight.updata_weight(hidden_size, input_size, self.dtype)
weight.update_weight(hidden_size, input_size, self.dtype)
rnn1 = LSTM(
input_size,
hidden_size,
Expand Down