def query_and_docs_feature_structure(self):
    """Nested structure of the features produced by featurize_query_and_docs.

    The leaves are all 'placeholders' with fully specified shapes and dtypes.
    This specification makes it easy to do generic, invertible conversions to
    different formats, such as flat lists or dictionaries.

    Note: we don't use `tf.placeholder` for our 'placeholder' tensors, because
    these are disallowed in eager execution mode. Instead, we just use constant
    zero Tensors.

    Returns:
      structure: A nested structure with fully-specified placeholders.
    """
    query_shape = [self.query_seq_len]
    candidate_shape = [self.num_candidates, self.candidate_seq_len]
    joint_shape = [
        self.num_candidates, self.query_seq_len + self.candidate_seq_len
    ]
    mlm_shape = [self.max_masks]
    return dict(
        query_inputs=BertInputs(
            token_ids=tf.zeros(query_shape, tf.int32),
            mask=tf.zeros(query_shape, tf.int32),
            segment_ids=tf.zeros(query_shape, tf.int32)),
        candidate_inputs=BertInputs(
            token_ids=tf.zeros(candidate_shape, tf.int32),
            mask=tf.zeros(candidate_shape, tf.int32),
            segment_ids=tf.zeros(candidate_shape, tf.int32)),
        joint_inputs=BertInputs(
            token_ids=tf.zeros(joint_shape, tf.int32),
            mask=tf.zeros(joint_shape, tf.int32),
            segment_ids=tf.zeros(joint_shape, tf.int32)),
        candidate_labels=tf.zeros([self.num_candidates], tf.float32),
        mlm_targets=tf.zeros(mlm_shape, tf.int32),
        mlm_positions=tf.zeros(mlm_shape, tf.int32),
        mlm_mask=tf.zeros(mlm_shape, tf.int32),
        export_timestamp=tf.zeros([], tf.int32))
Nested structure of the features produced by featurize_query_and_docs.

    The leaves are all 'placeholders' with fully specified shapes and dtypes.
    This specification makes it easy to do generic, invertible conversions to
    different formats, such as flat lists or dictionaries.

    Note: we don't use `tf.placeholder` for our 'placeholder' tensors, because
    these are disallowed in eager execution mode. Instead, we just use constant
    zero Tensors.

    Returns:
      structure: A nested structure with fully-specified placeholders.
    
language/realm/featurization.py