【问题标题】:Difference of torch.matmul and python built-in @ operator to do matrix multiplicationtorch.matmul和python内置@运算符做矩阵乘法的区别
【发布时间】:2020-01-22 05:14:20
【问题描述】:

我可以总是用 python 的内置 @ 运算符替换 torch.matmul 来进行矩阵乘法吗?请假设我知道 torch.matmul、torch.mm 和许多其他文件之间的区别。我只是想确保有多少可以安全地被@运算符替换,而不会牺牲速度或torch的一些本机支持。

如果没有害处,我想在未来广泛使用它们。

【问题讨论】:

    标签: python machine-learning deep-learning pytorch matrix-multiplication


    【解决方案1】:

    是的,您始终可以使用@ 代替.matmul。您也可以在numpy 中执行相同的操作。另见PyTorch mapping operators to functions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-29
      • 2012-11-24
      相关资源
      最近更新 更多