(self, data)
return feat, feat_len, txt, txt_len
Move data to device and compute text seq. length
Move data to device and compute text seq. length
Move data to device and compute text seq . length
def fetch_data(self, data):
        ''' Move data to device and compute text seq. length'''
        _, feat, feat_len, txt = data
        feat = feat.to(self.device)
        feat_len = feat_len.to(self.device)
        txt = txt.to(self.device)
        txt_len = torch.sum(txt != 0, dim=-1)

        return feat, feat_len, txt, txt_len
def fetch_data ( self , data ) : _ , feat , feat_len , txt = data feat = feat . to ( self . device ) feat_len = feat_len . to ( self . device ) txt = txt . to ( self . device ) txt_len = torch . sum ( txt != 0 , dim = - 1 ) return feat , feat_len , txt , txt_len