tf.get_session_handle()

tf.get_session_handle(data, name=None)

Return the handle of data.

This is EXPERIMENTAL and subject to change.

Keep data "in-place" in the runtime and create a handle that can be used to retrieve data in a subsequent run().

Combined with get_session_tensor, we can keep a tensor produced in one run call in place, and use it as the input in a future run call.

Args:
  • data: A tensor to be stored in the session.
  • name: Optional name prefix for the return tensor.
Returns:

A scalar string tensor representing a unique handle for data.

Raises:
  • TypeError: if data is not a Tensor.

  • Example:

c = tf.mul(a, b)
h = tf.get_session_handle(c)
h = sess.run(h)

p, a = tf.get_session_tensor(h.handle, tf.float32)
b = tf.mul(a, 10)
c = sess.run(b, feed_dict={p: h.handle})
doc_TensorFlow
2016-10-14 13:07:57
Comments
Leave a Comment

Please login to continue.