4.1 張量(Tensor)的更多操作 除了創(chuàng)建張量,我們還可以對(duì)張量進(jìn)行各種操作,如下所示: 1 2 3 4 5 6 7 8 9 # 創(chuàng)建張量 tensor1=tf.constant([[1,2], [3,4]]) tensor2=tf.constant([[5,6], [7,8]]) # 張量相加 add=tf.add(tensor1, tensor2) # 張量乘法 multiply=tf.matmul(tensor1, tenso...
www.dbjr.com.cn/python/3245770...htm 2025-6-4