code: def layers():
    
    global _cached_layers
    if _cached_layers is not None:
      return _cached_layers
    layers_module = tf.layers
    try:
      from tensorflow.python import tf2  # pylint: disable=g-direct-tensorflow-import,g-import-not-at-top
      if tf2.enabled():
        tf.logging.info("Running in V2 mode, using Keras layers.")
        layers_module = tf.keras.layers
    except ImportError:
      pass
    _cached_layers = layers_module
    return layers_module
docs: Get the layers module good for TF 1 and TF 2 work for now.