@@ -49,10 +49,10 @@ static PyObject *static_api_parameter(PyObject *self,
4949 PyObject *name_obj = PyTuple_GET_ITEM (args, 0 );
5050 std::string name = CastPyArg2String (name_obj, " name" , 0 );
5151 // Call ir static api
52- CallStackRecorder callstack_recoder (" parameter" );
53- callstack_recoder .Record ();
52+ CallStackRecorder callstack_recorder (" parameter" );
53+ callstack_recorder .Record ();
5454 auto static_api_out = paddle::dialect::parameter (name);
55- callstack_recoder .AttachToOps ();
55+ callstack_recorder .AttachToOps ();
5656 return ToPyObject (static_api_out);
5757 } catch (...) {
5858 ThrowExceptionToPython (std::current_exception ());
@@ -75,10 +75,10 @@ static PyObject *static_api_set_parameter(PyObject *self,
7575 PyObject *name_obj = PyTuple_GET_ITEM (args, 1 );
7676 std::string name = CastPyArg2String (name_obj, " name" , 1 );
7777 // Call ir static api
78- CallStackRecorder callstack_recoder (" set_parameter" );
79- callstack_recoder .Record ();
78+ CallStackRecorder callstack_recorder (" set_parameter" );
79+ callstack_recorder .Record ();
8080 paddle::dialect::set_parameter (parameter, name);
81- callstack_recoder .AttachToOps ();
81+ callstack_recorder .AttachToOps ();
8282 Py_RETURN_NONE;
8383 } catch (...) {
8484 ThrowExceptionToPython (std::current_exception ());
@@ -101,10 +101,10 @@ static PyObject *static_api_update_parameter(PyObject *self,
101101 PyObject *name_obj = PyTuple_GET_ITEM (args, 1 );
102102 std::string name = CastPyArg2String (name_obj, " name" , 1 );
103103 // Call ir static api
104- CallStackRecorder callstack_recoder (" uodata_parameter" );
105- callstack_recoder .Record ();
104+ CallStackRecorder callstack_recorder (" uodata_parameter" );
105+ callstack_recorder .Record ();
106106 paddle::dialect::update_parameter (parameter, name);
107- callstack_recoder .AttachToOps ();
107+ callstack_recorder .AttachToOps ();
108108 Py_RETURN_NONE;
109109 } catch (...) {
110110 ThrowExceptionToPython (std::current_exception ());
@@ -128,10 +128,10 @@ static PyObject *static_api_set_persistable_value(PyObject *self,
128128 PyObject *name_obj = PyTuple_GET_ITEM (args, 1 );
129129 std::string name = CastPyArg2String (name_obj, " name" , 1 );
130130 // Call ir static api
131- CallStackRecorder callstack_recoder (" shadow_output" );
132- callstack_recoder .Record ();
131+ CallStackRecorder callstack_recorder (" shadow_output" );
132+ callstack_recorder .Record ();
133133 paddle::dialect::shadow_output (persist_value, name);
134- callstack_recoder .AttachToOps ();
134+ callstack_recorder .AttachToOps ();
135135 Py_RETURN_NONE;
136136 } catch (...) {
137137 ThrowExceptionToPython (std::current_exception ());
@@ -160,18 +160,18 @@ PyObject *static_api_full(PyObject *self, PyObject *args, PyObject *kwargs) {
160160 if (PyComplex_Check (value_obj)) {
161161 phi::dtype::complex <float > complex_value =
162162 CastPyArg2Complex (value_obj, " full" , 1 );
163- CallStackRecorder callstack_recoder (" full" );
164- callstack_recoder .Record ();
163+ CallStackRecorder callstack_recorder (" full" );
164+ callstack_recorder .Record ();
165165 auto static_api_out = paddle::dialect::full (
166166 shape, complex_value.real , complex_value.imag , dtype, place);
167- callstack_recoder .AttachToOps ();
167+ callstack_recorder .AttachToOps ();
168168 return ToPyObject (static_api_out);
169169 } else {
170170 double value = CastPyArg2Double (value_obj, " full" , 1 );
171- CallStackRecorder callstack_recoder (" full" );
172- callstack_recoder .Record ();
171+ CallStackRecorder callstack_recorder (" full" );
172+ callstack_recorder .Record ();
173173 auto static_api_out = paddle::dialect::full (shape, value, dtype, place);
174- callstack_recoder .AttachToOps ();
174+ callstack_recorder .AttachToOps ();
175175 return ToPyObject (static_api_out);
176176 }
177177 } else {
@@ -209,11 +209,11 @@ PyObject *static_api_full(PyObject *self, PyObject *args, PyObject *kwargs) {
209209 }
210210 }
211211
212- CallStackRecorder callstack_recoder (" full_with_tensor" );
213- callstack_recoder .Record ();
212+ CallStackRecorder callstack_recorder (" full_with_tensor" );
213+ callstack_recorder .Record ();
214214 auto static_api_out =
215215 paddle::dialect::full_with_tensor (value, shape, dtype);
216- callstack_recoder .AttachToOps ();
216+ callstack_recorder .AttachToOps ();
217217
218218 return ToPyObject (static_api_out);
219219 }
@@ -236,10 +236,10 @@ static PyObject *static_api_create_array(PyObject *self,
236236 CastPyArg2DataTypeDirectly (dtype_obj, " create_array" , 0 );
237237
238238 // Call ir static api
239- CallStackRecorder callstack_recoder (" create_array" );
240- callstack_recoder .Record ();
239+ CallStackRecorder callstack_recorder (" create_array" );
240+ callstack_recorder .Record ();
241241 auto static_api_out = paddle::dialect::create_array (dtype);
242- callstack_recoder .AttachToOps ();
242+ callstack_recorder .AttachToOps ();
243243
244244 return ToPyObject (static_api_out);
245245 } catch (...) {
@@ -264,10 +264,10 @@ static PyObject *static_api_create_array_like(PyObject *self,
264264 float value = CastPyArg2Float (value_obj, " create_array_like" , 1 );
265265
266266 // Call ir static api
267- CallStackRecorder callstack_recoder (" create_array_like" );
268- callstack_recoder .Record ();
267+ CallStackRecorder callstack_recorder (" create_array_like" );
268+ callstack_recorder .Record ();
269269 auto static_api_out = paddle::dialect::create_array_like (input, value);
270- callstack_recoder .AttachToOps ();
270+ callstack_recorder .AttachToOps ();
271271 return ToPyObject (static_api_out);
272272 } catch (...) {
273273 ThrowExceptionToPython (std::current_exception ());
@@ -287,10 +287,10 @@ static PyObject *static_api_array_length(PyObject *self,
287287 auto x = CastPyArg2Value (x_obj, " array_length" , 0 , false );
288288
289289 // Call ir static api
290- CallStackRecorder callstack_recoder (" array_length" );
291- callstack_recoder .Record ();
290+ CallStackRecorder callstack_recorder (" array_length" );
291+ callstack_recorder .Record ();
292292 auto static_api_out = paddle::dialect::array_length (x);
293- callstack_recoder .AttachToOps ();
293+ callstack_recorder .AttachToOps ();
294294
295295 return ToPyObject (static_api_out);
296296 } catch (...) {
@@ -322,10 +322,10 @@ static PyObject *static_api_array_read(PyObject *self,
322322 }
323323
324324 // Call ir static api
325- CallStackRecorder callstack_recoder (" array_read" );
326- callstack_recoder .Record ();
325+ CallStackRecorder callstack_recorder (" array_read" );
326+ callstack_recorder .Record ();
327327 auto static_api_out = paddle::dialect::array_read (array, i);
328- callstack_recoder .AttachToOps ();
328+ callstack_recorder .AttachToOps ();
329329
330330 return ToPyObject (static_api_out);
331331 } catch (...) {
@@ -349,10 +349,10 @@ static PyObject *static_api_fetch(PyObject *self,
349349 int col = CastPyArg2Int (PyTuple_GET_ITEM (args, 2 ), " array_read" , 2 );
350350
351351 // Call ir static api
352- CallStackRecorder callstack_recoder (" fetch" );
353- callstack_recoder .Record ();
352+ CallStackRecorder callstack_recorder (" fetch" );
353+ callstack_recorder .Record ();
354354 auto static_api_out = paddle::dialect::fetch (value, name, col);
355- callstack_recoder .AttachToOps ();
355+ callstack_recorder .AttachToOps ();
356356
357357 return ToPyObject (static_api_out);
358358 } catch (...) {
@@ -386,10 +386,10 @@ static PyObject *static_api_array_write_(PyObject *self,
386386 }
387387
388388 // Call ir static api
389- CallStackRecorder callstack_recoder (" array_write_" );
390- callstack_recoder .Record ();
389+ CallStackRecorder callstack_recorder (" array_write_" );
390+ callstack_recorder .Record ();
391391 auto static_api_out = paddle::dialect::array_write_ (array, x, i);
392- callstack_recoder .AttachToOps ();
392+ callstack_recorder .AttachToOps ();
393393
394394 return ToPyObject (static_api_out);
395395 } catch (...) {
@@ -428,10 +428,10 @@ static PyObject *static_api_array_to_tensor(PyObject *self,
428428 auto use_stack = CastPyArg2Boolean (use_stack_obj, " array_to_tensor" , 2 );
429429
430430 // Call ir static api
431- CallStackRecorder callstack_recoder (" array_to_tensor" );
432- callstack_recoder .Record ();
431+ CallStackRecorder callstack_recorder (" array_to_tensor" );
432+ callstack_recorder .Record ();
433433 auto static_api_out = paddle::dialect::array_to_tensor (x, axis, use_stack);
434- callstack_recoder .AttachToOps ();
434+ callstack_recorder .AttachToOps ();
435435
436436 return ToPyObject (static_api_out);
437437 } catch (...) {
@@ -451,10 +451,10 @@ PyObject *static_api_add_n_array(PyObject *self,
451451 PyObject *inputs_obj = PyTuple_GET_ITEM (args, 0 );
452452 auto inputs = CastPyArg2VectorOfValue (inputs_obj, " add_n" , 0 , false );
453453
454- CallStackRecorder callstack_recoder (" add_n_array" );
455- callstack_recoder .Record ();
454+ CallStackRecorder callstack_recorder (" add_n_array" );
455+ callstack_recorder .Record ();
456456 auto static_api_out = paddle::dialect::add_n_array (inputs);
457- callstack_recoder .AttachToOps ();
457+ callstack_recorder .AttachToOps ();
458458
459459 return ToPyObject (static_api_out);
460460 } catch (...) {
@@ -505,10 +505,10 @@ static PyObject *static_api_slice_array(PyObject *self,
505505 }
506506
507507 // Call ir static api
508- CallStackRecorder callstack_recoder (" slice_array" );
509- callstack_recoder .Record ();
508+ CallStackRecorder callstack_recorder (" slice_array" );
509+ callstack_recorder .Record ();
510510 auto static_api_out = paddle::dialect::slice_array (input, starts, ends);
511- callstack_recoder .AttachToOps ();
511+ callstack_recorder .AttachToOps ();
512512
513513 return ToPyObject (static_api_out);
514514 } catch (...) {
@@ -544,10 +544,10 @@ static PyObject *static_api_slice_array_dense(PyObject *self,
544544 starts_tmp, phi::DataType::INT64, phi::CPUPlace ());
545545 }
546546 // Call ir static api
547- CallStackRecorder callstack_recoder (" slice_array_dense" );
548- callstack_recoder .Record ();
547+ CallStackRecorder callstack_recorder (" slice_array_dense" );
548+ callstack_recorder .Record ();
549549 auto static_api_out = paddle::dialect::slice_array_dense (input, starts);
550- callstack_recoder .AttachToOps ();
550+ callstack_recorder .AttachToOps ();
551551
552552 return ToPyObject (static_api_out);
553553 } catch (...) {
@@ -953,8 +953,8 @@ static PyObject *static_api_run_custom_op(PyObject *self,
953953
954954 argument.AddOutputs (argument_outputs.begin (), argument_outputs.end ());
955955 ::pir::PassStopGradientsDefaultly (argument);
956- CallStackRecorder callstack_recoder (" run_custom_op" );
957- callstack_recoder .Record ();
956+ CallStackRecorder callstack_recorder (" run_custom_op" );
957+ callstack_recorder .Record ();
958958 std::vector<pir::Value> op_results;
959959 pir::Operation *op =
960960 paddle::dialect::ApiBuilder::Instance ().GetBuilder ()->Build (
@@ -974,7 +974,7 @@ static PyObject *static_api_run_custom_op(PyObject *self,
974974 op_results.push_back (op->result (i));
975975 }
976976 }
977- callstack_recoder .AttachToOps ();
977+ callstack_recorder .AttachToOps ();
978978 return ToPyObject (op_results);
979979}
980980
@@ -999,10 +999,10 @@ static PyObject *builtin_combine_op(PyObject *self,
999999 // Get Value from args
10001000 PyObject *x_obj = PyTuple_GET_ITEM (args, 0 );
10011001 auto x = CastPyArg2VectorOfValue (x_obj, " builtin_combine" , 0 , false );
1002- CallStackRecorder callstack_recoder (" builtin_combine_op" );
1003- callstack_recoder .Record ();
1002+ CallStackRecorder callstack_recorder (" builtin_combine_op" );
1003+ callstack_recorder .Record ();
10041004 auto static_api_out = paddle::dialect::builtin_combine (x);
1005- callstack_recoder .AttachToOps ();
1005+ callstack_recorder .AttachToOps ();
10061006 return ToPyObject (static_api_out);
10071007 } catch (...) {
10081008 ThrowExceptionToPython (std::current_exception ());
@@ -1019,10 +1019,10 @@ static PyObject *builtin_split_op(PyObject *self,
10191019 // Get Value from args
10201020 PyObject *x_obj = PyTuple_GET_ITEM (args, 0 );
10211021 auto x = CastPyArg2Value (x_obj, " builtin_split" , 0 , false );
1022- CallStackRecorder callstack_recoder (" builtin_builtin_split" );
1023- callstack_recoder .Record ();
1022+ CallStackRecorder callstack_recorder (" builtin_builtin_split" );
1023+ callstack_recorder .Record ();
10241024 auto static_api_out = paddle::dialect::builtin_split (x);
1025- callstack_recoder .AttachToOps ();
1025+ callstack_recorder .AttachToOps ();
10261026 return ToPyObject (static_api_out);
10271027 } catch (...) {
10281028 ThrowExceptionToPython (std::current_exception ());
@@ -1054,11 +1054,11 @@ static PyObject *static_api_fused_gemm_epilogue(PyObject *self,
10541054 std::string activation =
10551055 CastPyArg2String (activation_obj, " fused_gemm_epilogue" , 5 );
10561056 // Call ir static api
1057- CallStackRecorder callstack_recoder (" fused_gemm_epilogue" );
1058- callstack_recoder .Record ();
1057+ CallStackRecorder callstack_recorder (" fused_gemm_epilogue" );
1058+ callstack_recorder .Record ();
10591059 auto out = paddle::dialect::fused_gemm_epilogue (
10601060 x, y, bias, trans_x, trans_y, activation);
1061- callstack_recoder .AttachToOps ();
1061+ callstack_recorder .AttachToOps ();
10621062
10631063 return ToPyObject (out);
10641064 } catch (...) {
@@ -1081,10 +1081,10 @@ static PyObject *static_api_array_pop(PyObject *self,
10811081 auto index = CastPyArg2Int (index_obj, " array_pop" , 1 );
10821082
10831083 // Call ir static api
1084- CallStackRecorder callstack_recoder (" array_pop" );
1085- callstack_recoder .Record ();
1084+ CallStackRecorder callstack_recorder (" array_pop" );
1085+ callstack_recorder .Record ();
10861086 auto static_api_out = paddle::dialect::array_pop (input, index);
1087- callstack_recoder .AttachToOps ();
1087+ callstack_recorder .AttachToOps ();
10881088 return ToPyObject (static_api_out);
10891089 } catch (...) {
10901090 ThrowExceptionToPython (std::current_exception ());
@@ -1161,8 +1161,8 @@ static PyObject *static_api_tensorrt_engine(PyObject *self,
11611161 std::string converter_debug_info =
11621162 CastPyArg2String (converter_debug_info_obj, " converter_debug_info" , 6 );
11631163 // Call ir static api
1164- CallStackRecorder callstack_recoder (" tensorrt_engine" );
1165- callstack_recoder .Record ();
1164+ CallStackRecorder callstack_recorder (" tensorrt_engine" );
1165+ callstack_recorder .Record ();
11661166 auto static_api_out =
11671167 paddle::dialect::tensorrt_engine (x,
11681168 trt_param,
@@ -1171,7 +1171,7 @@ static PyObject *static_api_tensorrt_engine(PyObject *self,
11711171 outputs_shape,
11721172 outputs_dtype,
11731173 converter_debug_info);
1174- callstack_recoder .AttachToOps ();
1174+ callstack_recorder .AttachToOps ();
11751175 return ToPyObject (static_api_out);
11761176 } catch (...) {
11771177 ThrowExceptionToPython (std::current_exception ());
@@ -1214,10 +1214,10 @@ static PyObject *share_var(PyObject *self, PyObject *args, PyObject *kwargs) {
12141214 // Get Value from args
12151215 PyObject *input_obj = PyTuple_GET_ITEM (args, 0 );
12161216 auto inputs = CastPyArg2VectorOfValue (input_obj, " share_var" , 0 , false );
1217- CallStackRecorder callstack_recoder (" share_var_op" );
1218- callstack_recoder .Record ();
1217+ CallStackRecorder callstack_recorder (" share_var_op" );
1218+ callstack_recorder .Record ();
12191219 auto share_var_op = paddle::dialect::share_var (inputs);
1220- callstack_recoder .AttachToOps ();
1220+ callstack_recorder .AttachToOps ();
12211221 return ToPyObject (share_var_op);
12221222 } catch (...) {
12231223 ThrowExceptionToPython (std::current_exception ());
0 commit comments