from local
This commit is contained in:
parent
ffde762b9d
commit
37dc394116
Binary file not shown.
@ -23,8 +23,6 @@ import torch.nn as nn
|
|||||||
from label_smoothing import LabelSmoothingLoss
|
from label_smoothing import LabelSmoothingLoss
|
||||||
from subsampling import Conv2dSubsampling, VggSubsampling
|
from subsampling import Conv2dSubsampling, VggSubsampling
|
||||||
from torch.nn.utils.rnn import pad_sequence
|
from torch.nn.utils.rnn import pad_sequence
|
||||||
from torch.nn.modules import Module
|
|
||||||
from torch import Tensor
|
|
||||||
# Note: TorchScript requires Dict/List/etc. to be fully typed.
|
# Note: TorchScript requires Dict/List/etc. to be fully typed.
|
||||||
Supervisions = Dict[str, torch.Tensor]
|
Supervisions = Dict[str, torch.Tensor]
|
||||||
|
|
||||||
@ -382,7 +380,7 @@ class Transformer(nn.Module):
|
|||||||
return nll
|
return nll
|
||||||
|
|
||||||
|
|
||||||
class TransformerEncoder(Module):
|
class TransformerEncoder(nn.TransformerEncoder):
|
||||||
r"""TransformerEncoder is a stack of N encoder layers. Users can build the
|
r"""TransformerEncoder is a stack of N encoder layers. Users can build the
|
||||||
BERT(https://arxiv.org/abs/1810.04805) model with corresponding parameters.
|
BERT(https://arxiv.org/abs/1810.04805) model with corresponding parameters.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user