1.运行以下代码 import tensorflow as tf a = tf.constant([1.0, 2.0], name="a") b = tf.constant([2.0, 3.0], name="b") result = a + b print result sess = tf.InteractiveSession () print(result.eval()) sess.close() 得到 其中,add与代码中的add有关,0表示第一个输出,图中的…
slim.flatten(inputs,outputs_collections=None,scope=None) (注:import tensorflow.contrib.slim as slim) 将输入扁平化但保留batch_size,假设第一维是batch. Args: inputs: a tensor of size [batch_size, …]. outputs_collections: collection to add the outputs. scope: Optional s…