Skip to content

Commit 4850f7d

Browse files
committed
rename add operation to z
1 parent fd00868 commit 4850f7d

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

examples/addition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn main() -> Result<(), Box<dyn Error>> {
4949
let mut args = SessionRunArgs::new();
5050
args.add_feed(&graph.operation_by_name_required("x")?, 0, &x);
5151
args.add_feed(&graph.operation_by_name_required("y")?, 0, &y);
52-
let z = args.request_fetch(&graph.operation_by_name_required("Identity")?, 0);
52+
let z = args.request_fetch(&graph.operation_by_name_required("z")?, 0);
5353
session.run(&mut args)?;
5454

5555
// Check our results.

examples/addition/addition.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66

77
@tf.function
88
def add(x, y):
9-
return tf.add(x, y)
9+
tf.add(x, y, name='z')
1010

1111
x = tf.TensorSpec((), dtype=tf.dtypes.int32, name='x')
1212
y = tf.TensorSpec((), dtype=tf.dtypes.int32, name='y')
1313

1414
concrete_function = add.get_concrete_function(x, y)
1515
directory = 'examples/addition'
1616
tf.io.write_graph(concrete_function.graph, directory, 'model.pb', as_text=False)
17-
18-
# check inputs/outputs node names to refer from Rust later on
19-
print(f'input nodes : {concrete_function.inputs}')
20-
print(f'output nodes : {concrete_function.outputs}')

examples/addition/model.pb

-38 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)