Short answer: you can use both get_operation_by_name()
and parameters get_tensor_by_name()
. Long answer:
tf.Operation
When you call
op = graph.get_operation_by_name('logits')
... it returns an instance of a type tf.Operation
, which is a node in a computational graph that executes some op on its inputs and produces one or more outputs. In this case, it is a plus
op.
You can always evaluate op in a session, and if this operator needs some placehoder values to be submitted, the engine will force you to provide them. Some operating systems, for example. reading a variable has no dependencies and can be performed without placeholders.
( ) logits
x
, logits
x
.
tf.Tensor
,
tensor = graph.get_tensor_by_name('logits:0')
... tensor
, tf.Tensor
:
Operation
.
A tensor
Operation
. , TensorFlow tf.Session
.
, , , , , .
tensor
? A tensor
Operation
, . , .