tf.add_n函数用法
tf.add_n([p1, p2, p3…])函数是实现一个列表的元素的相加。就是输入的对象是一个列表,列表里的元素可以是向量,矩阵,等import tensorflow as tfinput1 = tf.constant([1.0, 2.0, 3.0])input2 = tf.Variable(tf.random_uniform([3]))#生成1行3列均匀分布的随机值output = tf.add_n([input1, input2])input3 = tf.Variable(tf.ones
原创
2020-05-17 16:24:15 ·
888 阅读 ·
0 评论