def METHOD_NAME(self, mode, features, labels, records=None, **kwargs):
    features_pad = pad_sequence(features, batch_first=True)
    attention_mask = [torch.ones((feature.shape[0])) for feature in features] 
    attention_mask_pad = pad_sequence(attention_mask,batch_first=True)
    attention_mask_pad = (1.0 - attention_mask_pad) * -100000.0
    features_pad = self.connector(features_pad)
    intent_logits = self.model(features_pad, attention_mask_pad.cuda())
    intent_loss = 0
    start_index = 0
    predicted_intent = []
    #labels = torch.LongTensor(labels).to(features_pad.device)
    labels = torch.stack(labels).to(features_pad.device)
    for slot in range(len(self.values_per_slot)):
        end_index = start_index + self.values_per_slot[slot]
        subset = intent_logits[:, start_index:end_index]
        intent_loss += self.objective(subset, labels[:, slot])
        predicted_intent.append(subset.max(1)[1])
        start_index = end_index
    predicted_intent = torch.stack(predicted_intent, dim=1)
    records['acc'] += (predicted_intent == labels).prod(1).view(-1).cpu().float().tolist()
    records['intent_loss'].append(intent_loss.item())
    return intent_loss