import tensorflow as tf

  major, minor, _ = tf.version.VERSION.split('.')
  if not (int(major) >= 2 and tf2.enabled()):
    tf.compat.v1.logging.warning(
        'Tensorflow version (%s) found. TransformFeaturesLayer is supported '
        'only for TF 2.x with TF 2.x behaviors enabled and may not work as '
        'intended.', tf.version.VERSION)
  elif int(major) == 2 and int(minor) < 3:
    # TODO(varshaan): Log a more specific warning.
    tf.compat.v1.logging.warning(
        'Tensorflow version (%s) found. TransformFeaturesLayer may not work '
        'as intended if the SavedModel contains an initialization op.',
        tf.version.VERSION)


# TODO(b/162055065): Possibly switch back to inherit from Layer when possible.
@_maybe_register_keras_serializable(package='TensorFlowTransform')
