from torch import nn class EncoderLayer(nn.Module): def __init__(self, hidden_dim, d_ff, num_heads, use_attention=True, use_feedforward=True): super(EncoderLayer, self).__init__() # TODO: implement a single encoder layer, using Attention and FeedForward. pass def forward(self, x): # x shape: (seqlen, batch, hiddendim) # TODO: implement a single encoder layer, using Attention and FeedForward. result, att_weights = x, None # placeholder pass return result, att_weights