code: def test_input_basic(self, sparse):
      input_shape = (2, 3)
      batch_size = 4
      dtype = "float32"
      ndim = len(tuple((batch_size,) + input_shape))
  
      init_kwargs = {
          "shape": input_shape,
          "batch_size": batch_size,
          "dtype": dtype,
          "sparse": sparse,
      }
  
      if sparse and not backend.SUPPORTS_SPARSE_TENSORS:
          with self.assertRaisesRegex(
              ValueError, "`sparse=True` is not supported"
          ):
              InputLayer(**init_kwargs)
          return
  
      values = InputLayer(**init_kwargs)
  
      self.assertEqual(values.dtype, dtype)
      self.assertEqual(values.batch_shape[0], batch_size)
      self.assertEqual(values.batch_shape[1:], input_shape)
      self.assertEqual(values.sparse, sparse)
      self.assertEqual(values.trainable, True)
      self.assertIsInstance(values.output, KerasTensor)
      self.assertEqual(values.output.ndim, ndim)
      self.assertEqual(values.output.dtype, dtype)
      self.assertEqual(values.output.sparse, sparse)
  
file_path: keras/keras/layers/core/input_layer_test.py
imports: import numpy
  from absl.testing import parameterized
  from keras import backend
  from keras import testing
  from keras.backend import KerasTensor
  from keras.layers import InputLayer
label_desc: Use image node_id 1 for calling the InputLayerTest obj's underlying member method code with example usage: obj.test_input_basic(sparse) without return types