def get_static_bert_model(model_name=None, dataset_name=None, vocab=None,<EOL>pretrained=True, ctx=mx.cpu(),<EOL>use_pooler=True, use_decoder=True, use_classifier=True,<EOL>output_attention=False, output_all_encodings=False,<EOL>root=os.path.join(get_home_dir(), '<STR_LIT>'), input_size=None,<EOL>seq_length=None, **kwargs):
predefined_args = bert_hparams[model_name]<EOL>mutable_args = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>mutable_args = frozenset(mutable_args)<EOL>assert all((k not in kwargs or k in mutable_args) for k in predefined_args),'<STR_LIT>'<EOL>predefined_args.update(kwargs)<EOL>encoder = StaticBERTEncoder(attention_cell=predefined_args['<STR_LIT>'],<EOL>num_layers=predefined_args['<STR_LIT>'],<EOL>units=predefined_args['<STR_LIT>'],<EOL>hidden_size=predefined_args['<STR_LIT>'],<EOL>max_length=predefined_args['<STR_LIT:max_length>'],<EOL>num_heads=predefined_args['<STR_LIT>'],<EOL>scaled=predefined_args['<STR_LIT>'],<EOL>dropout=predefined_args['<STR_LIT>'],<EOL>output_attention=output_attention,<EOL>output_all_encodings=output_all_encodings,<EOL>use_residual=predefined_args['<STR_LIT>'],<EOL>input_size=input_size,<EOL>seq_length=seq_length)<EOL>if dataset_name in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>warnings.warn('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>bert_vocab = _load_vocab(dataset_name, vocab, root, cls=BERTVocab)<EOL>net = StaticBERTModel(encoder, len(bert_vocab),<EOL>token_type_vocab_size=predefined_args['<STR_LIT>'],<EOL>units=predefined_args['<STR_LIT>'],<EOL>embed_size=predefined_args['<STR_LIT>'],<EOL>embed_dropout=predefined_args['<STR_LIT>'],<EOL>word_embed=predefined_args['<STR_LIT>'],<EOL>use_pooler=use_pooler, use_decoder=use_decoder,<EOL>use_classifier=use_classifier)<EOL>if pretrained:<EOL><INDENT>ignore_extra = not (use_pooler and use_decoder and use_classifier)<EOL>_load_pretrained_params(net, model_name, dataset_name, root, ctx,<EOL>ignore_extra=ignore_extra)<EOL><DEDENT>return net, bert_vocab<EOL>
Any Static BERT pretrained model.

    Parameters
    ----------
    model_name : str or None, default None
        Options include 'bert_24_1024_16' and 'bert_12_768_12'.
    dataset_name : str or None, default None
        Options include 'book_corpus_wiki_en_cased', 'book_corpus_wiki_en_uncased'
        for both bert_24_1024_16 and bert_12_768_12.
        'wiki_cn_cased', 'wiki_multilingual_uncased' and 'wiki_multilingual_cased'
        for bert_12_768_12 only.
    vocab : gluonnlp.vocab.BERTVocab or None, default None
        Vocabulary for the dataset. Must be provided if dataset is not specified.
    pretrained : bool, default True
        Whether to load the pretrained weights for model.
    ctx : Context, default CPU
        The context in which to load the pretrained weights.
    root : str, default '$MXNET_HOME/models'
        Location for keeping the model parameters.
        MXNET_HOME defaults to '~/.mxnet'.
    use_pooler : bool, default True
        Whether to include the pooler which converts the encoded sequence tensor of shape
        (batch_size, seq_length, units) to a tensor of shape (batch_size, units)
        for for segment level classification task.
    use_decoder : bool, default True
        Whether to include the decoder for masked language model prediction.
    use_classifier : bool, default True
        Whether to include the classifier for next sentence classification.
    output_attention : bool, default False
        Whether to include attention weights of each encoding cell to the output.
    output_all_encodings : bool, default False
        Whether to output encodings of all encoder cells.
    input_size : int, default None
        Represents the embedding size of the input.
    seq_length : int, default None
        Stands for the sequence length of the input.

    Returns
    -------
    StaticBERTModel, gluonnlp.vocab.BERTVocab