LaVIN icon indicating copy to clipboard operation
LaVIN copied to clipboard

关于repAdapter_Router 代码的疑问

Open verigle opened this issue 2 years ago • 2 comments

        with autocast():
            if weights is None:
                #
                weights = torch.softmax(self.expert_weights(x[:, 0]) / self.t, -1).half()

请问self.expert_weights(x[:, 0]) 中为何取 x[: , 0] 作为输入参数呢? x 的shape 可以表示为 L, B, C 为何在B 维度上仅取0位置呢?

verigle avatar Sep 25 '23 04:09 verigle

x的shape是B,L, C, 所以取的是L的0位置,即cls token。 希望对你有帮助~

luogen1996 avatar Nov 14 '23 07:11 luogen1996

感谢

verigle avatar Nov 14 '23 10:11 verigle