rungjoo / CoMPM

Context Modeling with Speaker's Pre-trained Memory Tracking for Emotion Recognition in Conversation (NAACL 2022)
62 stars 14 forks source link

Why don't put batch_speaker_token on cuda? #15

Closed kkkMeng closed 11 months ago

kkkMeng commented 11 months ago

I am reading your code. And I found that, batch_speaker_tokens are not put on cuda. (The code is as below: )

    batch_input_tokens, batch_labels, batch_speaker_tokens = data
    batch_input_tokens, batch_labels = batch_input_tokens.cuda(), batch_labels.cuda()

However, I found the speaker_token is a list with only one Tensor. I am quite confused that, shall we remove the list, just use Tensor as batch_speaker_tokens? In this way, the speaker_tokens can be speed up by GPU.

By the way, I am wondering why you put a list outside the Tensor in batch_speaker_tokens. I think there might be a reason for doing so.

Many thanks.

kkkMeng commented 11 months ago

Oops. Never mind. I found it transformed to cuda in model.py