V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
flyaway
V2EX  ›  问与答

Python 奇怪语法求助

  •  
  •   flyaway · Apr 20, 2019 · 2323 views
    This topic created in 2565 days ago, the information mentioned may be changed or developed.

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

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

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

    5 replies    2019-04-20 00:30:10 +08:00
    pythonbug
        1
    pythonbug  
       Apr 20, 2019 via iPhone
    没见过
    Tony042
        2
    Tony042  
       Apr 20, 2019
    矩阵相乘,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
        3
    azh7138m  
       Apr 20, 2019 via Android
    azh7138m
        4
    azh7138m  
       Apr 20, 2019 via Android
    其实搜
    python @ meaning
    quora 出现在首页的那个回答,也说的这个
    flyaway
        5
    flyaway  
    OP
       Apr 20, 2019
    @pythonbug
    @Tony042
    @azh7138m
    多谢各位~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3180 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 14:29 · PVG 22:29 · LAX 07:29 · JFK 10:29
    ♥ Do have faith in what you're doing.