class_docstr: A `Dataset` that groups its input and performs a reduction.
class_docstr_tok: ["A","`","Dataset","`","that","groups","its","input","and","performs","a","reduction","."]
docstr: Make wrapping defun for key_func.
docstr_tok: ["Make","wrapping","defun","for","key_func","."]
code: def _make_key_func(self, key_func, input_dataset):
      """Make wrapping defun for key_func."""
      self._key_func = structured_function.StructuredFunctionWrapper(
          key_func, self._transformation_name(), dataset=input_dataset
      )
      if not self._key_func.output_structure.is_compatible_with(
          tensor_spec.TensorSpec([], dtypes.int64)
      ):
          raise ValueError(
              f"Invalid `key_func`. Expected `key_func` to return a scalar "
              f"tf.int64 tensor, but instead `key_func` has output "
              f"types={self._key_func.output_types} "
              f"and shapes={self._key_func.output_shapes}."
          )
  
imports: from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import structured_function
  from tensorflow.python.data.util import nest
  from tensorflow.python.data.util import structure
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.ops import gen_experimental_dataset_ops
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 2 for calling the _GroupByReducerDataset obj's underlying member method code with example usage: obj._make_key_func(key_func, input_dataset) without return types