class_docstr: HiFiC Model class.
class_docstr_tok: ["HiFiC","Model","class","."]
docstr: Make sure we train the right variables.
docstr_tok: ["Make","sure","we","train","the","right","variables","."]
code: def _get_and_check_variables(self):
      """Make sure we train the right variables."""
      entropy_vars = list(
          itertools.chain.from_iterable(
              x.trainable_variables for x in self._entropy_layers
          )
      )
      transform_vars = list(
          itertools.chain.from_iterable(
              x.trainable_variables for x in self._transform_layers
          )
      )
      # Just getting these for book-keeping
      transform_vars_non_trainable = list(
          itertools.chain.from_iterable(
              x.variables for x in self._transform_layers
          )
      )
      disc_vars = (
          self._discriminator.trainable_variables
          if self._setup_discriminator
          else []
      )
  
      # Check that we didn't miss any variables.
      all_trainable = set(tf.trainable_variables())
      all_known = set(transform_vars + entropy_vars + disc_vars)
      if (all_trainable != all_known) and all_trainable != set(
          transform_vars_non_trainable
      ) | all_known:
          all_known |= set(transform_vars_non_trainable)
          missing_in_trainable = all_known - all_trainable
          missing_in_known = all_trainable - all_known
          non_trainable_vars_str = "\n".join(
              sorted(v.name for v in transform_vars_non_trainable)
          )
          raise ValueError(
              "Did not capture all variables! "
              + " Missing in trainable: "
              + str(missing_in_trainable)
              + " Missing in known: "
              + str(missing_in_known)
              + " \n\nNon trainable transform vars: "
              + non_trainable_vars_str
          )
  
      return entropy_vars, transform_vars, disc_vars
  
imports: import collections
  import glob
  import itertools
  from compare_gan.gans import loss_lib
  import tensorflow.compat.v1
  import tensorflow_datasets
  from hific import archs
  from hific import helpers
  from hific.helpers import ModelMode
  from hific.helpers import ModelType
  from hific.helpers import TFDSArguments
label_desc: Use image node_id 28 for calling the HiFiC obj's underlying member method code with example usage: obj._get_and_check_variables() and returns: entropy_vars,  transform_vars,  disc_vars