gpt4 book ai didi

tensorflow - Tensorflow 中的 tf.matmul 和 tf.batch_matmul 有什么区别?

转载 作者:行者123 更新时间:2023-12-03 21:52:25 26 4
gpt4 key购买 nike

例如,如果我有以下数据:

x = tf.placeholder("float", [None, n, n])
y = tf.placeholder("float", [None, n, n])

这两种操作有什么区别吗?
res = tf.matmul(x,y)
res = tf.batch_matmul(x,y)

最佳答案

tf.batch_matmul不赞成使用 tf.matmul在 0.12 及更高版本中,因此在更高版本中没有区别。早期版本需要 matmul 的 rank-2 输入但允许更大的排名 batch_matmul

关于tensorflow - Tensorflow 中的 tf.matmul 和 tf.batch_matmul 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41940189/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com