GraphWriter
GraphWriter copied to clipboard
some question about list_encode?
def forward(self,batch,pad=True): batch,phlens,batch_lens = batch batch_lens = tuple(batch_lens.tolist())#list-to-tuple _,enc = self.seqenc((batch,phlens)) enc = enc[:,2:] enc = torch.cat([enc[:,i] for i in range(enc.size(1))],1) m = max(batch_lens) encs = [self.pad(x,m) for x in enc.split(batch_lens)] out = torch.stack(encs,0) return out i don't understand why use enc = enc[:,2:] and enc = torch.cat([enc[:,i] for i in range(enc.size(1))],1)??? anybody can explain to me?thanks .