class_docstr: A preprocessing layer which crosses features using the "hashing trick".
  
  This layer performs crosses of categorical features using the "hashing
  trick". Conceptually, the transformation can be thought of as:
  `hash(concatenate(features)) % num_bins.
  
  This layer currently only performs crosses of scalar inputs and batches of
  scalar inputs. Valid input shapes are `(batch_size, 1)`, `(batch_size,)` and
  `()`.
  
  **Note:** This layer wraps `tf.keras.layers.HashedCrossing`. It cannot
  be used as part of the compiled computation graph of a model with
  any backend other than TensorFlow.
  It can however be used with any backend when running eagerly.
  It can also always be used as part of an input preprocessing pipeline
  with any backend (outside the model itself), which is how we recommend
  to use this layer.
  
  **Note:** This layer is safe to use inside a `tf.data` pipeline
  (independently of which backend you're using).
  
  Args:
      num_bins: Number of hash bins.
      output_mode: Specification for the output of the layer. Values can be
          `"int"`, or `"one_hot"` configuring the layer as follows:
          - `"int"`: Return the integer bin indices directly.
          - `"one_hot"`: Encodes each individual element in the input into an
              array the same size as `num_bins`, containing a 1 at the input's
              bin index. Defaults to `"int"`.
      sparse: Boolean. Only applicable to `"one_hot"` mode and only valid
          when using the TensorFlow backend. If `True`, returns
          a `SparseTensor` instead of a dense `Tensor`. Defaults to `False`.
      **kwargs: Keyword arguments to construct a layer.
  
  Examples:
  
  **Crossing two scalar features.**
  
  >>> layer = keras.layers.HashedCrossing(
  ...     num_bins=5)
  >>> feat1 = np.array(['A', 'B', 'A', 'B', 'A'])
  >>> feat2 = np.array([101, 101, 101, 102, 102])
  >>> layer((feat1, feat2))
  array([1, 4, 1, 1, 3])
  
  **Crossing and one-hotting two scalar features.**
  
  >>> layer = keras.layers.HashedCrossing(
  ...     num_bins=5, output_mode='one_hot')
  >>> feat1 = np.array(['A', 'B', 'A', 'B', 'A'])
  >>> feat2 = np.array([101, 101, 101, 102, 102])
  >>> layer((feat1, feat2))
  array([[0., 1., 0., 0., 0.],
          [0., 0., 0., 0., 1.],
          [0., 1., 0., 0., 0.],
          [0., 1., 0., 0., 0.],
          [0., 0., 0., 1., 0.]], dtype=float32)
class_docstr_tok: ["A","preprocessing","layer","which","crosses","features","using","the","``","hashing","trick","''",".","This","layer","performs","crosses","of","categorical","features","using","the","``","hashing","trick","''",".","Conceptually",",","the","transformation","can","be","thought","of","as",":","`","hash","(","concatenate","(","features",")",")","%","num_bins",".","This","layer","currently","only","performs","crosses","of","scalar","inputs","and","batches","of","scalar","inputs",".","Valid","input","shapes","are","`","(","batch_size",",","1",")","`",",","`","(","batch_size",",",")","`","and","`","(",")","`",".","*","*","Note",":","*","*","This","layer","wraps","`","tf.keras.layers.HashedCrossing","`",".","It","can","not","be","used","as","part","of","the","compiled","computation","graph","of","a","model","with","any","backend","other","than","TensorFlow",".","It","can","however","be","used","with","any","backend","when","running","eagerly",".","It","can","also","always","be","used","as","part","of","an","input","preprocessing","pipeline","with","any","backend","(","outside","the","model","itself",")",",","which","is","how","we","recommend","to","use","this","layer",".","*","*","Note",":","*","*","This","layer","is","safe","to","use","inside","a","`","tf.data","`","pipeline","(","independently","of","which","backend","you","'re","using",")",".","Args",":","num_bins",":","Number","of","hash","bins",".","output_mode",":","Specification","for","the","output","of","the","layer",".","Values","can","be","`","``","int","''","`",",","or","`","``","one_hot","''","`","configuring","the","layer","as","follows",":","-","`","``","int","''","`",":","Return","the","integer","bin","indices","directly",".","-","`","``","one_hot","''","`",":","Encodes","each","individual","element","in","the","input","into","an","array","the","same","size","as","`","num_bins","`",",","containing","a","1","at","the","input's","bin","index",".","Defaults","to","`","``","int","''","`",".","sparse",":","Boolean",".","Only","applicable","to","`","``","one_hot","''","`","mode","and","only","valid","when","using","the","TensorFlow","backend",".","If","`","True","`",",","returns","a","`","SparseTensor","`","instead","of","a","dense","`","Tensor","`",".","Defaults","to","`","False","`",".","*","*","kwargs",":","Keyword","arguments","to","construct","a","layer",".","Examples",":","*","*","Crossing","two","scalar","features",".","*","*",">",">",">","layer","=","keras.layers.HashedCrossing","(","...","num_bins=5",")",">",">",">","feat1","=","np.array","(","[","'","A","'",",","'","B","'",",","'","A","'",",","'","B","'",",","'","A","'","]",")",">",">",">","feat2","=","np.array","(","[","101",",","101",",","101",",","102",",","102","]",")",">",">",">","layer","(","(","feat1",",","feat2",")",")","array","(","[","1",",","4",",","1",",","1",",","3","]",")","*","*","Crossing","and","one-hotting","two","scalar","features",".","*","*",">",">",">","layer","=","keras.layers.HashedCrossing","(","...","num_bins=5",",","output_mode='one_hot","'",")",">",">",">","feat1","=","np.array","(","[","'","A","'",",","'","B","'",",","'","A","'",",","'","B","'",",","'","A","'","]",")",">",">",">","feat2","=","np.array","(","[","101",",","101",",","101",",","102",",","102","]",")",">",">",">","layer","(","(","feat1",",","feat2",")",")","array","(","[","[","0.",",","1.",",","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","0.",",","0.",",","1",".","]",",","[","0.",",","1.",",","0.",",","0.",",","0",".","]",",","[","0.",",","1.",",","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","0.",",","1.",",","0",".","]","]",",","dtype=float32",")"]
code: def compute_output_shape(self, input_shape):
      if (
          not len(input_shape) == 2
          or not isinstance(input_shape[0], tuple)
          or not isinstance(input_shape[1], tuple)
      ):
          raise ValueError(
              "Expected as input a list/tuple of 2 tensors. "
              f"Received input_shape={input_shape}"
          )
      if input_shape[0][-1] != input_shape[1][-1]:
          raise ValueError(
              "Expected the two input tensors to have identical shapes. "
              f"Received input_shape={input_shape}"
          )
  
      if not input_shape:
          if self.output_mode == "int":
              return ()
          return (self.num_bins,)
      if self.output_mode == "int":
          return input_shape[0]
  
      if self.output_mode == "one_hot" and input_shape[0][-1] != 1:
          return tuple(input_shape[0]) + (self.num_bins,)
  
      return tuple(input_shape[0])[:-1] + (self.num_bins,)
  
file_path: keras/keras/layers/preprocessing/hashed_crossing.py
imports: from keras import backend
  from keras.api_export import keras_export
  from keras.layers.layer import Layer
  from keras.utils import argument_validation
  from keras.utils import backend_utils
  from keras.utils import tf_utils
  from keras.utils.module_utils import tensorflow
label_desc: Use image node_id 2 for calling the HashedCrossing obj's underlying member method code with example usage: obj.compute_output_shape(input_shape) and returns: unknown, self, input_shape, unknown, 