forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tfg][functiondef_import] Emit error on empty function attributes
Disallow empty function attributes. Emit an error when one is encountered. PiperOrigin-RevId: 448629968
- Loading branch information
1 parent
230e240
commit 1cf45b8
Showing
2 changed files
with
54 additions
and
0 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
52 changes: 52 additions & 0 deletions
52
...flow/core/ir/importexport/tests/graphdef_to_mlir/invalid_generic_function_attr_name.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,52 @@ | ||
# RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s | ||
|
||
# CHECK: Invalid function attribute name | ||
|
||
library { | ||
function { | ||
signature { | ||
name: "foo" | ||
input_arg { | ||
name: "a" | ||
} | ||
output_arg { | ||
name: "d" | ||
} | ||
} | ||
node_def { | ||
op: "Const" | ||
attr { | ||
key: "_b" | ||
value { | ||
placeholder: "T" | ||
} | ||
} | ||
attr { | ||
key: "dtype" | ||
value { | ||
type: DT_INT32 | ||
} | ||
} | ||
attr { | ||
key: "value" | ||
value { | ||
tensor { | ||
dtype: DT_INT32 | ||
tensor_shape { | ||
} | ||
} | ||
} | ||
} | ||
} | ||
ret { | ||
key: "d" | ||
value: "a" | ||
} | ||
attr { | ||
key: "" | ||
value { | ||
s: "a" | ||
} | ||
} | ||
} | ||
} |