class_docstr: A class representing a training dataset for KB.
  Dataset.dataset is a tf.data.Dataset object and Dataset.iterator is an
  iterator over the dataset.
  Dataset.input_tensors are the input tensors used in downstream model, it
  can be returned by Dataset.get_input_tensors()
  Dataset iteration parameters are:
  batchsize: size of each mini-batch
  num_epochs: number of epochs to iterate over the dataset
  
  Each tuple is processed to include the neighborhoods of the entities using
  the following parameters:
  max_neighbors: maximum number of entities in the neighborhood, if None this
  is specified from train_graph
  max_negatives: maximum  number of negative entities samples for each example
class_docstr_tok: ["A","class","representing","a","training","dataset","for","KB",".","Dataset.dataset","is","a","tf.data.Dataset","object","and","Dataset.iterator","is","an","iterator","over","the","dataset",".","Dataset.input_tensors","are","the","input","tensors","used","in","downstream","model",",","it","can","be","returned","by","Dataset.get_input_tensors","(",")","Dataset","iteration","parameters","are",":","batchsize",":","size","of","each","mini-batch","num_epochs",":","number","of","epochs","to","iterate","over","the","dataset","Each","tuple","is","processed","to","include","the","neighborhoods","of","the","entities","using","the","following","parameters",":","max_neighbors",":","maximum","number","of","entities","in","the","neighborhood",",","if","None","this","is","specified","from","train_graph","max_negatives",":","maximum","number","of","negative","entities","samples","for","each","example"]
docstr: Set shapes of tensors.
docstr_tok: ["Set","shapes","of","tensors","."]
code: def get_output_shapes(self):
      """Set shapes of tensors."""
      if not self.output_shapes:
          s_shape = tf.TensorShape([None])
          r_shape = tf.TensorShape([None])
          candidates_shape = tf.TensorShape([None, None])
          if self.model_type == "distmult":
              nbrs_s_shape = tf.TensorShape([None])
              nbrs_candidates_shape = tf.TensorShape([None])
          elif self.model_type == "source_attention":
              nbrs_s_shape = tf.TensorShape([None, self.max_neighbors])
              nbrs_candidates_shape = tf.TensorShape([None])
          elif self.model_type == "source_rel_attention":
              nbrs_s_shape = tf.TensorShape(
                  [None, self.max_neighbors, 2]
              )
              nbrs_candidates_shape = tf.TensorShape([None])
          elif self.model_type == "source_path_attention":
              nbrs_s_shape = tf.TensorShape(
                  [
                      None,
                      self.max_neighbors,
                      2 * self.train_graph.max_path_length,
                  ]
              )
              nbrs_candidates_shape = tf.TensorShape([None])
          else:
              nbrs_s_shape = tf.TensorShape([None, self.max_neighbors])
              nbrs_candidates_shape = tf.TensorShape(
                  [None, None, self.max_neighbors]
              )
          labels_shape = tf.TensorShape([None, None])
          if isinstance(
              self.train_graph, clueweb_text_graph.CWTextGraph
          ):
              text_nbrs_s_shape = tf.TensorShape(
                  [None, self.max_text_neighbors]
              )
              text_nbrs_s_emb_shape = tf.TensorShape(
                  [None, self.max_text_neighbors, None]
              )
              self.output_shapes = (
                  s_shape,
                  nbrs_s_shape,
                  text_nbrs_s_shape,
                  r_shape,
                  candidates_shape,
                  nbrs_candidates_shape,
                  labels_shape,
                  text_nbrs_s_emb_shape,
              )
          elif self.max_text_len:
              text_nbrs_s_shape = tf.TensorShape(
                  [None, self.max_text_neighbors, self.max_text_len + 1]
              )
              self.output_shapes = (
                  s_shape,
                  nbrs_s_shape,
                  text_nbrs_s_shape,
                  r_shape,
                  candidates_shape,
                  nbrs_candidates_shape,
                  labels_shape,
              )
          else:
              self.output_shapes = (
                  s_shape,
                  nbrs_s_shape,
                  r_shape,
                  candidates_shape,
                  nbrs_candidates_shape,
                  labels_shape,
              )
      return self.output_shapes
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import clueweb_text_graph
  import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling the Dataset obj's underlying member method code with example usage: obj.get_output_shapes() and returns: self