Skip to content

Commit 8e321bd

Browse files
committed
add operation creation log
1 parent 0c6f8cd commit 8e321bd

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

docs/source/ControlDependency.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Chapter. Control Dependency
2+
3+
4+

docs/source/NameScope.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Chapter. Name Scoping
2+
3+
Typical TensorFlow graphs can have many thousands of nodes--far too many to see easily all at once, or even to lay out using standard graph tools. To simplify, variable names can be scoped and the visualization uses this information to define a hierarchy on the nodes in the graph. By default, only the top of this hierarchy is shown. Here is an example that defines three operations under the `hidden` name scope using `tf.name_scope`:
4+

docs/source/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ Welcome to TensorFlow.NET's documentation!
2323
Graph
2424
Operation
2525
Attribute
26+
NameScope
27+
ControlDependency
2628
Gradient
2729
EagerMode

src/TensorFlowNET.Core/Graphs/Graph.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ public unsafe Operation create_op(string op_type, List<Tensor> inputs, TF_DataTy
138138
op_def: op_def);
139139

140140
_create_op_helper(op, true);
141+
142+
Console.Write($"create_op: {op_type} '{node_def.Name}'");
143+
Console.Write($", inputs: {(inputs.Count == 0 ? "empty" : String.Join(",", inputs.Select(x => x.name)))}");
144+
Console.Write($", outputs: {(op.outputs.Length == 0 ? "empty" : String.Join(",", op.outputs.Select(x => x.name)))}");
145+
Console.WriteLine();
146+
141147
return op;
142148
}
143149

0 commit comments

Comments
 (0)