src/transformers/models/layoutlm/modeling_tf_layoutlm.py/TFLayoutLMEmbeddings/build
class TFLayoutLMEmbeddings:    def build(self, input_shape: tf.TensorShape):
        with tf.name_scope("word_embeddings"):
            self.weight = self.add_weight(
                name="weight",
                shape=[self.vocab_size, self.hidden_size],
                initializer=get_initializer(self.initializer_range),
            )

        with tf.name_scope("token_type_embeddings"):
            self.token_type_embeddings = self.add_weight(
                name="embeddings",
                shape=[self.type_vocab_size, self.hidden_size],
                initializer=get_initializer(self.initializer_range),
            )

        with tf.name_scope("position_embeddings"):
            self.position_embeddings = self.add_weight(
                name="embeddings",
                shape=[self.max_position_embeddings, self.hidden_size],
                initializer=get_initializer(self.initializer_range),
            )

        with tf.name_scope("x_position_embeddings"):
            self.x_position_embeddings = self.add_weight(
                name="embeddings",
                shape=[self.max_2d_position_embeddings, self.hidden_size],
                initializer=get_initializer(self.initializer_range),
            )

        with tf.name_scope("y_position_embeddings"):
            self.y_position_embeddings = self.add_weight(
                name="embeddings",
                shape=[self.max_2d_position_embeddings, self.hidden_size],
                initializer=get_initializer(self.initializer_range),
            )

        with tf.name_scope("h_position_embeddings"):
            self.h_position_embeddings = self.add_weight(
                name="embeddings",
                shape=[self.max_2d_position_embeddings, self.hidden_size],
                initializer=get_initializer(self.initializer_range),
            )

        with tf.name_scope("w_position_embeddings"):
            self.w_position_embeddings = self.add_weight(
                name="embeddings",
                shape=[self.max_2d_position_embeddings, self.hidden_size],
                initializer=get_initializer(self.initializer_range),
            )

        super().build(input_shape)