class_docstr: Base class for wrapping compare_gan classes as keras layers.
  
  The main task of this class is to provide a keras-like interface, which
  includes a `trainable_variables`. This is non-trivial however, as
  compare_gan uses tf.get_variable. So we try to use the name scope to find
  these variables.
class_docstr_tok: ["Base","class","for","wrapping","compare_gan","classes","as","keras","layers",".","The","main","task","of","this","class","is","to","provide","a","keras-like","interface",",","which","includes","a","`","trainable_variables","`",".","This","is","non-trivial","however",",","as","compare_gan","uses","tf.get_variable",".","So","we","try","to","use","the","name","scope","to","find","these","variables","."]
docstr: Constructor.
  
  Args:
    name: Name of the layer. IMPORTANT: Setting this to the same string
      for two different layers will cause unexpected behavior since variables
      are found using this name.
    compare_gan_cls: A class from compare_gan, which should inherit from
      either AbstractGenerator or AbstractDiscriminator.
    **compare_gan_kwargs: keyword arguments passed to compare_gan_cls to
      construct it.
docstr_tok: ["Constructor",".","Args",":","name",":","Name","of","the","layer",".","IMPORTANT",":","Setting","this","to","the","same","string","for","two","different","layers","will","cause","unexpected","behavior","since","variables","are","found","using","this","name",".","compare_gan_cls",":","A","class","from","compare_gan",",","which","should","inherit","from","either","AbstractGenerator","or","AbstractDiscriminator",".","*","*","compare_gan_kwargs",":","keyword","arguments","passed","to","compare_gan_cls","to","construct","it","."]
code: def __init__(self, name, compare_gan_cls, **compare_gan_kwargs):
      """Constructor.
  
      Args:
        name: Name of the layer. IMPORTANT: Setting this to the same string
          for two different layers will cause unexpected behavior since variables
          are found using this name.
        compare_gan_cls: A class from compare_gan, which should inherit from
          either AbstractGenerator or AbstractDiscriminator.
        **compare_gan_kwargs: keyword arguments passed to compare_gan_cls to
          construct it.
      """
      super(_CompareGANLayer, self).__init__(name=name)
      compare_gan_kwargs["name"] = name
      self._name = name
      self._model = compare_gan_cls(**compare_gan_kwargs)
  
imports: import collections
  from compare_gan.architectures import abstract_arch
  from compare_gan.architectures import arch_ops
  import numpy
  import tensorflow.compat.v1
  import tensorflow_compression
  from hific.helpers import ModelMode
label_desc: Use image node_id 1 to create a new _CompareGANLayer object from inherited base classes: tf.keras.layers with example: obj = _CompareGANLayer(name, compare_gan_cls)