# Path: disentanglement_lib/evaluation/abstract_reasoning/relational_layers.py
# class RelationalLayer(tf.keras.layers.Layer):
# class PairwiseEdgeEmbeddings(tf.keras.layers.Layer):
# class AddPositionalEncoding(tf.keras.layers.Layer):
# class StackAnswers(tf.keras.layers.Layer):
# class MultiDimBatchApply(tf.keras.layers.Layer):
#   def __init__(self, edge_layer, reduce_layer):
#   def call(self, inputs, **kwargs):
#   def call(self, inputs, **kwargs):
# def repeat(tensor, num, axis):
# def positional_encoding_like(tensor, positional_encoding_axis=-2,
#                              value_axis=-1):
#   def __init__(self, positional_encoding_axis=-2, embedding_axis=-1):
#   def call(self, inputs, **kwargs):
#   def __init__(self, answer_axis=-2, stack_axis=-3):
#   def call(self, inputs, **kwargs):
#   def __init__(self, layer, num_dims_to_keep=3):
#   def call(self, inputs, **kwargs):


from disentanglement_lib.evaluation.abstract_reasoning import relational_layers
from tensorflow.contrib import tpu as contrib_tpu
import gin
import tensorflow.compat.v1 as tf
import tensorflow_hub as hub
              activation=get_activation(),
              kernel_initializer=get_kernel_initializer())
      ]
    self.edge_layer = tf.keras.models.Sequential(edge_layers, "edge_mlp")

    # Create the GraphMLP.
    graph_layers = []
    for num_units in graph_mlp:
      graph_layers += [
          tf.keras.layers.Dense(
              num_units,
              activation=get_activation(),
              kernel_initializer=get_kernel_initializer())
      ]
    if dropout_in_last_graph_layer:
      graph_layers += [
          tf.keras.layers.Dropout(
              1. - dropout_in_last_graph_layer,
              noise_shape=[1, 1, graph_mlp[-1]])
      ]
    graph_layers += [
        tf.keras.layers.Dense(1, kernel_initializer=get_kernel_initializer())
    ]

    # Create the auxiliary layers.
    self.graph_layer = tf.keras.models.Sequential(graph_layers, "graph_mlp")
    self.stacking_layer = relational_layers.StackAnswers()

    # Create the WildRelationNet.
    self.wildrelnet = tf.keras.models.Sequential([

# Path: disentanglement_lib/evaluation/abstract_reasoning/relational_layers.py
# class RelationalLayer(tf.keras.layers.Layer):
# class PairwiseEdgeEmbeddings(tf.keras.layers.Layer):
# class AddPositionalEncoding(tf.keras.layers.Layer):
# class StackAnswers(tf.keras.layers.Layer):
# class MultiDimBatchApply(tf.keras.layers.Layer):
#   def __init__(self, edge_layer, reduce_layer):
#   def call(self, inputs, **kwargs):
#   def call(self, inputs, **kwargs):
# def repeat(tensor, num, axis):
# def positional_encoding_like(tensor, positional_encoding_axis=-2,
#                              value_axis=-1):
#   def __init__(self, positional_encoding_axis=-2, embedding_axis=-1):
#   def call(self, inputs, **kwargs):
#   def __init__(self, answer_axis=-2, stack_axis=-3):
#   def call(self, inputs, **kwargs):
#   def __init__(self, layer, num_dims_to_keep=3):
#   def call(self, inputs, **kwargs):


# Path: disentanglement_lib/evaluation/abstract_reasoning/models.py
from disentanglement_lib.evaluation.abstract_reasoning import relational_layers
from tensorflow.contrib import tpu as contrib_tpu
import gin
import tensorflow.compat.v1 as tf
import tensorflow_hub as hub

              activation=get_activation(),
              kernel_initializer=get_kernel_initializer())
      ]
    self.edge_layer = tf.keras.models.Sequential(edge_layers, "edge_mlp")

    # Create the GraphMLP.
    graph_layers = []
    for num_units in graph_mlp:
      graph_layers += [
          tf.keras.layers.Dense(
              num_units,
              activation=get_activation(),
              kernel_initializer=get_kernel_initializer())
      ]
    if dropout_in_last_graph_layer:
      graph_layers += [
          tf.keras.layers.Dropout(
              1. - dropout_in_last_graph_layer,
              noise_shape=[1, 1, graph_mlp[-1]])
      ]
    graph_layers += [
        tf.keras.layers.Dense(1, kernel_initializer=get_kernel_initializer())
    ]

    # Create the auxiliary layers.
    self.graph_layer = tf.keras.models.Sequential(graph_layers, "graph_mlp")
    self.stacking_layer = relational_layers.StackAnswers()

    # Create the WildRelationNet.
    self.wildrelnet = tf.keras.models.Sequential([

        relational_layers.AddPositionalEncoding(),