def __init__(self, question_encoder, context_encoder, dropout, output_emb_size=768, state=None):
    super(BiEncoder, self).__init__()
    self.state = state
    if (self.state == None):
        self.question_encoder = question_encoder
        self.context_encoder = context_encoder
    elif (self.state == 'FORQUESTION'):
        self.question_encoder = question_encoder
    elif (self.state == 'FORCONTEXT'):
        self.context_encoder = context_encoder
    self.dropout = nn.Dropout((dropout if (dropout is not None) else 0.1))
    weight_attr = paddle.ParamAttr(initializer=paddle.nn.initializer.TruncatedNormal(std=0.02))
    self.emb_reduce_linear = paddle.nn.Linear(768, output_emb_size, weight_attr=weight_attr)
def __init__(self, question_encoder, context_encoder, dropout, output_emb_size=768, state=None):
    super(BiEncoder, self).__init__()
    self.state = state
    if (self.state == None):
        self.question_encoder = question_encoder
        self.context_encoder = context_encoder
    elif (self.state == 'FORQUESTION'):
        self.question_encoder = question_encoder
    elif (self.state == 'FORCONTEXT'):
        self.context_encoder = context_encoder
    self.dropout = nn.Dropout((dropout if (dropout is not None) else 0.1))
    weight_attr = paddle.ParamAttr(initializer=paddle.nn.initializer.TruncatedNormal(std=0.02))
    self.emb_reduce_linear = paddle.nn.Linear(768, output_emb_size, weight_attr=weight_attr)