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:
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: