#3创建形状为 2 2 的随机张量 a 和形状为 2 2 的随机张量 b计算它们的点积。tensorflow
import tensorflow as tf
a = tf.random.normal([2, 2]) b = tf.random.normal([2, 2])
dot_product = tf.tensordot(a, b, axes=1)
print(dot_product) # 输出两个张量的点积
原文地址: https://www.cveoy.top/t/topic/eZpd 著作权归作者所有。请勿转载和采集!