1. 程式人生 > >tensorflow隨筆-佇列(9)

tensorflow隨筆-佇列(9)

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Sep  6 10:16:37 2018
@author: myhaspl
@email:[email protected]
"""

import tensorflow as tf
 
q=tf.RandomShuffleQueue(capacity=10,min_after_dequeue=2,dtypes="float")



with tf.Session() as sess:    
    for i in range(0,10):
        sess.run(q.enqueue(i))
    for i in range(0,8):
        print sess.run(q.dequeue())


    

    
4.0
5.0
8.0
7.0
3.0
0.0
2.0
1.0