# Path: disentanglement_lib/methods/shared/architectures.py
# def make_gaussian_encoder(input_tensor,
#                           is_training=True,
#                           num_latent=gin.REQUIRED,
#                           encoder_fn=gin.REQUIRED):
# def make_decoder(latent_tensor,
#                  output_shape,
#                  is_training=True,
#                  decoder_fn=gin.REQUIRED):
# def make_discriminator(input_tensor,
#                        is_training=False,
#                        discriminator_fn=gin.REQUIRED):
# def fc_encoder(input_tensor, num_latent, is_training=True):
# def conv_encoder(input_tensor, num_latent, is_training=True):
# def fc_decoder(latent_tensor, output_shape, is_training=True):
# def deconv_decoder(latent_tensor, output_shape, is_training=True):
# def fc_discriminator(input_tensor, is_training=True):
# def test_encoder(input_tensor, num_latent, is_training):
# def test_decoder(latent_tensor, output_shape, is_training=False):


from absl.testing import parameterized
from disentanglement_lib.methods.shared import architectures
import numpy as np
import tensorflow.compat.v1 as tf
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for the architectures.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


class ArchitecturesTest(parameterized.TestCase, tf.test.TestCase):

  @parameterized.named_parameters(
      ('fc_encoder', architectures.fc_encoder),
      ('conv_encoder', architectures.conv_encoder),
  )
  def test_encoder(self, encoder_f):
    minibatch = np.ones(shape=(10, 64, 64, 1), dtype=np.float32)
    input_tensor = tf.placeholder(tf.float32, shape=(None, 64, 64, 1))
    latent_mean, latent_logvar = encoder_f(input_tensor, 10)
    with self.test_session() as sess:
      sess.run(tf.initialize_all_variables())
      sess.run(
          [latent_mean, latent_logvar], feed_dict={input_tensor: minibatch})

  @parameterized.named_parameters(

# Path: disentanglement_lib/methods/shared/architectures.py
# def make_gaussian_encoder(input_tensor,
#                           is_training=True,
#                           num_latent=gin.REQUIRED,
#                           encoder_fn=gin.REQUIRED):
# def make_decoder(latent_tensor,
#                  output_shape,
#                  is_training=True,
#                  decoder_fn=gin.REQUIRED):
# def make_discriminator(input_tensor,
#                        is_training=False,
#                        discriminator_fn=gin.REQUIRED):
# def fc_encoder(input_tensor, num_latent, is_training=True):
# def conv_encoder(input_tensor, num_latent, is_training=True):
# def fc_decoder(latent_tensor, output_shape, is_training=True):
# def deconv_decoder(latent_tensor, output_shape, is_training=True):
# def fc_discriminator(input_tensor, is_training=True):
# def test_encoder(input_tensor, num_latent, is_training):
# def test_decoder(latent_tensor, output_shape, is_training=False):


# Path: disentanglement_lib/methods/shared/architectures_test.py
from absl.testing import parameterized
from disentanglement_lib.methods.shared import architectures
import numpy as np
import tensorflow.compat.v1 as tf

#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for the architectures.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


class ArchitecturesTest(parameterized.TestCase, tf.test.TestCase):

  @parameterized.named_parameters(
      ('fc_encoder', architectures.fc_encoder),
      ('conv_encoder', architectures.conv_encoder),
  )
  def test_encoder(self, encoder_f):
    minibatch = np.ones(shape=(10, 64, 64, 1), dtype=np.float32)
    input_tensor = tf.placeholder(tf.float32, shape=(None, 64, 64, 1))
    latent_mean, latent_logvar = encoder_f(input_tensor, 10)
    with self.test_session() as sess:
      sess.run(tf.initialize_all_variables())
      sess.run(
          [latent_mean, latent_logvar], feed_dict={input_tensor: minibatch})

  @parameterized.named_parameters(

      ('fc_decoder', architectures.fc_decoder),