import tempfile import tensorflow as tf input_data = [1, 2, 3, 5, 8] dataset = tf.data.Dataset.from_tensor_slices(input_data) # 定义迭代器. iterator = dataset.make_one_shot_iterator() # get_next() 返回代表一个输入数据的张量. x = iterator.get_next() y = x * x with tf.S…