zhouhaoyi / Informer2020

The GitHub repository for the paper "Informer" accepted by AAAI 2021.
Apache License 2.0
5.24k stars 1.1k forks source link

关于解码器的self.mix为True时的疑惑,out.shape = 32,96,8,72, 为什么要将out变成32,8,96,72呢? #592

Open 2578440997 opened 8 months ago

2578440997 commented 8 months ago
queries = self.query_projection(queries).view(B, L, H, -1)
        keys = self.key_projection(keys).view(B, S, H, -1)
        values = self.value_projection(values).view(B, S, H, -1)

        out, attn = self.inner_attention(
            queries,
            keys,
            values,
            attn_mask
        )
        if self.mix:
            #此时out.shape = 32,96,8,72
            out = out.transpose(2, 1).contiguous()
            #此时out.shape = 32,8,96,72
        out = out.view(B, L, -1)
        #此时out.shape = 32,72,512
        return self.out_projection(out), attn

关于解码器的self.mix为True时, 此时out.shape = 32,96,8,72, 为什么要将变成32,8,96,72呢?

xgmcn commented 7 months ago

同问