def get_feature(self, inp):
        """
        Get feature vector of given sentences
        :param inp: batch_size * max_seq_len
        :return: batch_size * feature_dim
        """
        hidden = self.init_hidden(inp.size(0))

        emb = self.embeddings(input)  # batch_size * seq_len * embedding_dim
        emb = emb.permute(1, 0, 2)  # seq_len * batch_size * embedding_dim
        _, hidden = self.gru(emb, hidden)  # 4 * batch_size * hidden_dim
        hidden = hidden.permute(1, 0, 2).contiguous()  # batch_size * 4 * hidden_dim
        out = self.gru2hidden(hidden.view(-1, 4 * self.hidden_dim))  # batch_size * 4 * hidden_dim
        feature = torch.tanh(out)  # batch_size * feature_dim

        return feature

        Get feature vector of given sentences
        :param inp: batch_size * max_seq_len
        :return: batch_size * feature_dim
        
models/discriminator.py