Python 奇怪语法求助

2019-04-20 00:12:40 +08:00
 flyaway

在看别人代码的时候,发现如下用法,从没见过,有没有大佬指导一下?

def get_most_similar_fast(self, v):
        scores = self.normed(v) @ self.embs._normalized_matrix.T
        scores = (scores + 1) / 2
        return scores

中间的 @符号是什么意思?

1555 次点击
所在节点    问与答
5 条回复
pythonbug
2019-04-20 00:24:20 +08:00
没见过
Tony042
2019-04-20 00:25:09 +08:00
矩阵相乘,The @ (at) operator is intended to be used for matrix multiplication. No builtin Python types implement this operator. From Python 3.7.3 documentation.
azh7138m
2019-04-20 00:26:32 +08:00
azh7138m
2019-04-20 00:28:56 +08:00
其实搜
python @ meaning
quora 出现在首页的那个回答,也说的这个
flyaway
2019-04-20 00:30:10 +08:00
@pythonbug
@Tony042
@azh7138m
多谢各位~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/556937

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX