Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

transformer in pytorch

>>> transformer_model = nn.Transformer(nhead=16, num_encoder_layers=12)
>>> src = torch.rand((10, 32, 512))
>>> tgt = torch.rand((20, 32, 512))
>>> out = transformer_model(src, tgt)
Source by pytorch.org #
 
PREVIOUS NEXT
Tagged: #transformer #pytorch
ADD COMMENT
Topic
Name
9+1 =