Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[tfg][functiondef_import] Error on empty edge names
Return an error in the generic function importer if an edge name is empty. PiperOrigin-RevId: 449953062
- Loading branch information
1 parent
cb12f7d
commit ad069af
Showing
4 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
.../importexport/tests/graphdef_to_mlir/invalid_generic_func_with_empty_control_result.pbtxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s | ||
|
|
||
| # CHECK: Function 'foo' has empty control result name | ||
|
|
||
| library { | ||
| function { | ||
| signature { | ||
| name: "foo" | ||
| control_output: "output" | ||
| } | ||
| node_def { | ||
| name: "y" | ||
| op: "NoOp" | ||
| attr { | ||
| key: "T" | ||
| value { | ||
| placeholder: "T" | ||
| } | ||
| } | ||
| } | ||
| control_ret { | ||
| key: "output" | ||
| value: "" | ||
| } | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
...w/core/ir/importexport/tests/graphdef_to_mlir/invalid_generic_func_with_empty_input.pbtxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s | ||
|
|
||
| # CHECK: Node 'y' has an empty input | ||
|
|
||
| library { | ||
| function { | ||
| signature { | ||
| name: "foo" | ||
| } | ||
| node_def { | ||
| name: "y" | ||
| input: "" | ||
| op: "Identity" | ||
| attr { | ||
| key: "T" | ||
| value { | ||
| placeholder: "T" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
.../core/ir/importexport/tests/graphdef_to_mlir/invalid_generic_func_with_empty_result.pbtxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s | ||
|
|
||
| # CHECK: Function 'foo' has empty result name | ||
|
|
||
| library { | ||
| function { | ||
| signature { | ||
| name: "foo" | ||
| output_arg { | ||
| name: "output" | ||
| type: DT_INT32 | ||
| } | ||
| } | ||
| node_def { | ||
| name: "y" | ||
| op: "NoOp" | ||
| attr { | ||
| key: "T" | ||
| value { | ||
| placeholder: "T" | ||
| } | ||
| } | ||
| } | ||
| ret { | ||
| key: "output" | ||
| value: "" | ||
| } | ||
| } | ||
| } |