How to get a tensorflow op by name?

后端 未结 1 1744
死守一世寂寞
死守一世寂寞 2020-12-08 20:28

You can get a tensor by name with tf.get_default_graph().get_tensor_by_name(\"tensor_name:0\")

But can you get an operation, such as Optimizer.min

相关标签:
1条回答
  • 2020-12-08 21:15

    You can use the tf.Graph.get_operation_by_name() method to get a tf.Operation by name. For example, to get an operation called "enqueue" from the default graph:

    op = tf.get_default_graph().get_operation_by_name("enqueue")
    
    0 讨论(0)
提交回复
热议问题