Skip to content

Commit

Permalink
Rename EagerOperation::FunctionDef() to `EagerOperation::GetFunctio…
Browse files Browse the repository at this point in the history
…nDef()`.

Some compilers do not like using the name of a class as a method, which is fair enough.

PiperOrigin-RevId: 588312567
  • Loading branch information
mrry authored and draganmladjenovic committed Dec 12, 2023
1 parent 4d21b57 commit d24bced
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/eager/eager_operation.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class EagerOperation : public ImmediateExecutionOperation {
}
}

const FunctionDef* FunctionDef() const {
const FunctionDef* GetFunctionDef() const {
if (is_function_) {
return FuncLibDef()->Find(attrs_.op_name());
} else {
Expand Down
8 changes: 4 additions & 4 deletions tensorflow/core/common_runtime/eager/execute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Status GetOutputDTypes(EagerOperation* op, DataTypeVector* output_dtypes) {
const auto& node_def = op->MutableAttrs()->BuildNodeDef();
const OpDef* op_def = nullptr;

const FunctionDef* function_def = op->FunctionDef();
const FunctionDef* function_def = op->GetFunctionDef();
if (function_def != nullptr) {
op_def = &(function_def->signature());
} else {
Expand Down Expand Up @@ -419,7 +419,7 @@ Status GetFuncAttr(const EagerOperation* op, const EagerContext& ctx,
return OkStatus();
}

const FunctionDef* function_def = op->FunctionDef();
const FunctionDef* function_def = op->GetFunctionDef();
if (function_def == nullptr) {
return errors::NotFound("Failed to find function '", op->Name(), "'");
}
Expand All @@ -443,7 +443,7 @@ Status HasTPUReplication(const EagerOperation& op, const EagerContext& ctx,
return OkStatus();
}

const FunctionDef* function_def = op.FunctionDef();
const FunctionDef* function_def = op.GetFunctionDef();
if (function_def == nullptr) {
return errors::NotFound("Failed to find function '", op.Name(), "'");
}
Expand Down Expand Up @@ -1546,7 +1546,7 @@ Status GetOrCreateKernelAndDevice(
// programs that build input pipeline graphs in a loop.
const OpDef* op_def;
if (op->is_function()) {
const FunctionDef* function_def = op->FunctionDef();
const FunctionDef* function_def = op->GetFunctionDef();
if (function_def != nullptr) {
op_def = &(function_def->signature());
} else {
Expand Down

0 comments on commit d24bced

Please sign in to comment.