| 911 | } |
| 912 | |
| 913 | void GenEagerPythonOp::AddEagerExecute(const string& indentation, |
| 914 | const string& num_outputs_expr) { |
| 915 | const string return_prefix = |
| 916 | strings::StrCat(indentation, "_result = _execute.execute("); |
| 917 | const string return_args = strings::StrCat( |
| 918 | "b\"", op_def_.name(), "\", ", num_outputs_expr, |
| 919 | ", inputs=_inputs_flat, attrs=_attrs, ctx=_ctx, name=name)"); |
| 920 | strings::StrAppend(&result_, |
| 921 | // Wrap the arguments, and indent to the (. |
| 922 | WordWrap(return_prefix, return_args, kRightMargin), "\n"); |
| 923 | } |
| 924 | |
| 925 | void GenEagerPythonOp::AddDispatch(const string& prefix) { |
| 926 | if (api_def_.visibility() != ApiDef::VISIBLE) return; |