目录
本文主要讲,在使用rnn时,如何将不同长度的序列进行统一长度的处理,以便批量投入模型操作。
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
from torch.nn.utils.rnn import pack_padded_sequen
本文主要讲,在使用rnn时,如何将不同长度的序列进行统一长度的处理,以便批量投入模型操作。
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
from torch.nn.utils.rnn import pack_padded_sequen