    def _matmul_with_relative_keys(self, x, y):
        """
        x: [b, h, l, d]
        y: [h or 1, m, d]
        ret: [b, h, l, m]
        """
        ret = torch.matmul(x, y.unsqueeze(0).transpose(-2, -1))
        return ret
x: [b, h, l, d]
y: [h or 1, m, d]
ret: [b, h, l, m]
models/codec/facodec/modules/attentions.py