def __init__(self, max_position, segment_vocab_size=2, with_pool=False, with_nsp=False, with_mlm=False, hierarchical_position=None, custom_position_ids=False, shared_segment_embeddings=False, **kwargs):
    super(BERT, self).__init__(**kwargs)
    self.max_position = max_position
    self.segment_vocab_size = segment_vocab_size
    self.with_pool = with_pool
    self.with_nsp = with_nsp
    self.with_mlm = with_mlm
    self.hierarchical_position = hierarchical_position
    self.custom_position_ids = custom_position_ids
    self.shared_segment_embeddings = shared_segment_embeddings
    if (self.with_nsp and (not self.with_pool)):
        self.with_pool = True
def __init__(self, max_position, segment_vocab_size=2, with_pool=False, with_nsp=False, with_mlm=False, hierarchical_position=None, custom_position_ids=False, shared_segment_embeddings=False, **kwargs):
    super(BERT, self).__init__(**kwargs)
    self.max_position = max_position
    self.segment_vocab_size = segment_vocab_size
    self.with_pool = with_pool
    self.with_nsp = with_nsp
    self.with_mlm = with_mlm
    self.hierarchical_position = hierarchical_position
    self.custom_position_ids = custom_position_ids
    self.shared_segment_embeddings = shared_segment_embeddings
    if (self.with_nsp and (not self.with_pool)):
        self.with_pool = True