code: def testTukeyHHAnalyzersWithSparseInputs(
      self, input_dtype, output_dtypes, elementwise=True
  ):
      def analyzer_fn(inputs):
          a = tf.cast(inputs["a"], input_dtype)
  
          def assert_and_cast_dtype(tensor, out_dtype):
              self.assertEqual(tensor.dtype, out_dtype)
              return tf.cast(
                  tensor, tft_unit.canonical_numeric_dtype(out_dtype)
              )
  
          return {
              "tukey_location": assert_and_cast_dtype(
                  tft.tukey_location(
                      a, reduce_instance_dims=not elementwise
                  ),
                  output_dtypes["tukey_location"],
              ),
              "tukey_scale": assert_and_cast_dtype(
                  tft.tukey_scale(
                      a, reduce_instance_dims=not elementwise
                  ),
                  output_dtypes["tukey_scale"],
              ),
              "tukey_hl": assert_and_cast_dtype(
                  tft.tukey_h_params(
                      a, reduce_instance_dims=not elementwise
                  )[0],
                  output_dtypes["tukey_hl"],
              ),
              "tukey_hr": assert_and_cast_dtype(
                  tft.tukey_h_params(
                      a, reduce_instance_dims=not elementwise
                  )[1],
                  output_dtypes["tukey_hr"],
              ),
          }
  
      input_data_values = [
          516,
          -871,
          737,
          415,
          584,
          583,
          152,
          479,
          576,
          409,
          591,
          844,
          -16,
          508,
          669,
          617,
          502,
          532,
          517,
          479,
      ]
      input_data = []
      for idx, v in enumerate(input_data_values):
          input_data.append(
              {
                  "idx0": [0, 0],
                  "idx1": [0, 1],
                  "val": [v, -input_data_values[-1 - idx]],
              }
          )
      input_metadata = tft.DatasetMetadata.from_feature_spec(
          {
              "a": tf.io.SparseFeature(
                  ["idx0", "idx1"],
                  "val",
                  tft_unit.canonical_numeric_dtype(input_dtype),
                  (2, 2),
              )
          }
      )
  
      expected_outputs = {
          "tukey_location": np.array(
              [[526.89355, -526.89355], [0.0, 0.0]]
              if elementwise
              else 0.0,
              tft_unit.canonical_numeric_dtype(
                  output_dtypes["tukey_location"]
              ).as_numpy_dtype,
          ),
          "tukey_scale": np.array(
              [[116.73997, 116.73997], [1.0, 1.0]]
              if elementwise
              else 572.2776,
              tft_unit.canonical_numeric_dtype(
                  output_dtypes["tukey_scale"]
              ).as_numpy_dtype,
          ),
          "tukey_hl": np.array(
              [[0.6629082, 0.11148566], [0.0, 0.0]]
              if elementwise
              else 0.0,
              tft_unit.canonical_numeric_dtype(
                  output_dtypes["tukey_hl"]
              ).as_numpy_dtype,
          ),
          "tukey_hr": np.array(
              [[0.11148566, 0.6629082], [0.0, 0.0]]
              if elementwise
              else 0.0,
              tft_unit.canonical_numeric_dtype(
                  output_dtypes["tukey_hr"]
              ).as_numpy_dtype,
          ),
      }
  
      self.assertAnalyzerOutputs(
          input_data,
          input_metadata,
          analyzer_fn,
          expected_outputs,
          desired_batch_size=20,
          # Runs the test deterministically on the whole batch.
          beam_pipeline=beam.Pipeline(),
      )
  
file_path: transform/tensorflow_transform/beam/tukey_hh_params_integration_test.py
imports: import itertools
  import apache_beam
  import numpy
  import tensorflow
  import tensorflow_transform
  from tensorflow_transform.beam import impl
  from tensorflow_transform.beam import impl_test
  from tensorflow_transform.beam import tft_unit
label_desc: Use image node_id 8 for calling the TukeyHHParamsIntegrationTest obj's underlying member method code with example usage: obj.testTukeyHHAnalyzersWithSparseInputs(input_dtype, output_dtypes, elementwise) and returns: dict, tf