message: Unify kwargs in Input, and slightly clean up the logic.
diff: @@ -204,7 +204,8 @@ def Input( # pylint: disable=invalid-name
  values of 'None' in the 'shape' argument represent ragged dimensions.
  For more information about RaggedTensors, see
  https://www.tensorflow.org/guide/ragged_tensors.
  - **kwargs: deprecated arguments support.
  + **kwargs: deprecated arguments support. Supports `batch_shape` and
  + `batch_input_shape`.
  Returns:
  A `tensor`.
  @@ -235,15 +236,21 @@ def Input( # pylint: disable=invalid-name
  raise ValueError(
  'Cannot set both sparse and ragged to True in a Keras input.')
  - batch_shape = None
  - if 'batch_shape' in kwargs:
  - batch_shape = kwargs.pop('batch_shape')
  - if shape and batch_shape:
  - raise ValueError('Only provide the shape OR '
  - 'batch_shape argument to '
  - 'Input, not both at the same time.')
  - batch_size = batch_shape[0]
  - shape = batch_shape[1:]
  + input_layer_config = {'name': name, 'dtype': dtype, 'sparse': sparse,
  + 'ragged': ragged, 'input_tensor': tensor}
  +
  + batch_input_shape = kwargs.pop('batch_input_shape',
  + kwargs.pop('batch_shape', None))
  + if shape and batch_input_shape:
  + raise ValueError('Only provide the `shape` OR `batch_input_shape` argument '
  + 'to Input, not both at the same time.')
  + if batch_input_shape:
  + shape = batch_input_shape[1:]
  + input_layer_config.update({'batch_input_shape': batch_input_shape})
  + else:
  + input_layer_config.update(
  + {'batch_size': batch_size, 'input_shape': shape})
  +
  if kwargs:
  raise ValueError('Unrecognized keyword arguments:', kwargs.keys())
  @@ -253,23 +260,7 @@ def Input( # pylint: disable=invalid-name
  '`shape` does not include the batch '
  'dimension.')
  - if batch_shape:
  - input_layer = InputLayer(
  - batch_input_shape=batch_shape,
  - name=name,
  - dtype=dtype,
  - sparse=sparse,
  - ragged=ragged,
  - input_tensor=tensor)
  - else:
  - input_layer = InputLayer(
  - input_shape=shape,
  - batch_size=batch_size,
  - name=name,
  - dtype=dtype,
  - sparse=sparse,
  - ragged=ragged,
  - input_tensor=tensor)
  + input_layer = InputLayer(**input_layer_config)
  # Return tensor including `_keras_history`.
  # Note that in this case train_output and test_output are the same pointer.
  