import tensorflow as tf x=tf.constant([[1,2],[3,4]]) y=tf.constant([[1],[1]])#列向量 z=tf.constant([1,1])#行向量 u=x+y v=x+z print(u) print(v)
tensorflow中矩陣可以和矢量相加,
輸出結果:
import tensorflow as tf x=tf.constant([[1,2],[3,4]]) y=tf.constant([[1],[1]])#列向量 z=tf.constant([1,1])#行向量 u=x+y v=x+z print(u) print(v)
tensorflow中矩陣可以和矢量相加,
輸出結果:
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。