tensorflow in a matrix and a vector sum

import tensorflow as tf

x=tf.constant([[1,2],[3,4]])
Y = tf.constant ([[. 1], [. 1]]) # column vector 
Z = tf.constant ([1,1]) # row vector 

U = X + Y
v=x+z

print (u)
 print (v)

and the matrix may tensorflow vector addition,

 

 Output:

 

 

Guess you like

Origin www.cnblogs.com/sinceret/p/11723227.html