def __init__(self, config, *inputs, **kwargs):
    super(TFOpenAIGPTMainLayer, self).__init__(config, *inputs, **kwargs)
    self.output_hidden_states = config.output_hidden_states
    self.output_attentions = config.output_attentions
    self.num_hidden_layers = config.n_layer
    self.vocab_size = config.vocab_size
    self.n_embd = config.n_embd
    self.tokens_embed = TFSharedEmbeddings(config.vocab_size, config.n_embd, initializer_range=config.initializer_range, name='tokens_embed')
    self.positions_embed = tf.keras.layers.Embedding(config.n_positions, config.n_embd, embeddings_initializer=get_initializer(config.initializer_range), name='positions_embed')
    self.drop = tf.keras.layers.Dropout(config.embd_pdrop)
    self.h = [TFBlock(config.n_ctx, config, scale=True, name='h_._{}'.format(i)) for i in range(config.n_layer)]
def __init__(self, config, *inputs, **kwargs):
    super(TFOpenAIGPTMainLayer, self).__init__(config, *inputs, **kwargs)
    self.output_hidden_states = config.output_hidden_states
    self.output_attentions = config.output_attentions
    self.num_hidden_layers = config.n_layer
    self.vocab_size = config.vocab_size
    self.n_embd = config.n_embd
    self.tokens_embed = TFSharedEmbeddings(config.vocab_size, config.n_embd, initializer_range=config.initializer_range, name='tokens_embed')
    self.positions_embed = tf.keras.layers.Embedding(config.n_positions, config.n_embd, embeddings_initializer=get_initializer(config.initializer_range), name='positions_embed')
    self.drop = tf.keras.layers.Dropout(config.embd_pdrop)
    self.h = [TFBlock(config.n_ctx, config, scale=True, name='h_._{}'.format(i)) for i in range(config.n_layer)]