tensorflow uses the data set (tf.data) method to manipulate the data set.
1. Manipulate the array (memory vector):
Import tensorflow AS TF Input_Data = [. 1, 2,. 3,. 4,. 5 ] # from the array data set generated DataSet = tf.data.Dataset.from_tensor_slices (Input_Data) # DataSet dataset.shuffle = (. 3) # DataSet = dataset.repeat (10) # DataSet = dataset.batch (2) DataSet dataset.shuffle = (. 3) .repeat (10) .batch (2 ) # define iterators. iterator = dataset.make_one_shot_iterator () # get_next () returns a tensor that represents an input data (batch). x = iterator.get_next () y = x * x coord = tf.train.Coordinator () with tf.Session () as sess: for i in range(25): print(sess.run(y))