MCPcopy Create free account
hub / github.com/WarmCongee/SDUMC / forward

Method forward

toolkit/models/modules/encoder.py:63–72  ·  view source on GitHub ↗

Args: x: tensor of shape (batch_size, sequence_len, in_size) 因为用的是 final_states ,所以特征的 padding 是放在前面的

(self, x)

Source from the content-addressed store, hash-verified

61 self.linear_1 = nn.Linear(hidden_size, hidden_size)
62
63 def forward(self, x):
64 '''
65 Args:
66 x: tensor of shape (batch_size, sequence_len, in_size)
67 因为用的是 final_states ,所以特征的 padding 是放在前面的
68 '''
69 _, final_states = self.rnn(x)
70 h = self.dropout(final_states[0].squeeze(0))
71 y_1 = self.linear_1(h)
72 return y_1

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected