Is there a no-op (pass-through) operation in a tensor stream?

According to the title. I would like to use such an operation to rename nodes and better organize the schedule. Or is there another recommended practice for renaming an existing node in a chart? Thanks!

+6
source share
2 answers

As far as I know, you cannot rename the tensor after creation.

However, you can use additional "no-op" operations (as you said):

  • for tf.Tensor : tf.identity(input_tensor, name='your_new_name')

  • for operation: tf.group(input_operation, name='your_new_name')


After that, you can call input_tensor with:

 graph = tf.get_default_graph() graph.get_tensor_by_name('your_new_name:0') 

Or input_operation with:

 graph = tf.get_default_graph() graph.get_operation_by_name('your_new_name') 
+4
source

There is tf.no_op that allows you to add an operation that does nothing.

+9
source

All Articles