Created
October 28, 2017 14:52
-
-
Save bzamecnik/44a3642c05afc2ac09135687edce8a9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
from tensorflow.python.ops.data_flow_ops import StagingArea | |
dataset_range = tf.contrib.data.Dataset.range(10) | |
iter = dataset_range.make_one_shot_iterator() | |
next_item = iter.get_next() | |
area = StagingArea(dtypes=[tf.int64]) | |
area_put = area.put([next_item]) | |
area_get = area.get() | |
with tf.Session() as sess: | |
print('put:', sess.run(area_put)) | |
print('size:', sess.run(area.size())) | |
print('put(); get() =', sess.run(tf.group(area_put, area_get))) | |
print('size:', sess.run(area.size())) | |
# put: None | |
# size: 1 | |
# put(); get() = None | |
# size: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment