code: def _validate_scalarization_parameter_shape(
      multi_objectives: tf.Tensor,
      params: Dict[str, Union[Sequence[ScalarFloat], tf.Tensor]],
  ):
      """A private helper that validates the shapes of scalarization parameters.
  
      Every scalarization parameter in the input dictionary is either a 1-D tensor
      or `Sequence`, or a tensor whose shape matches the shape of the input
      `multi_objectives` tensor. This is invoked by the `Scalarizer.call` method.
  
      Args:
        multi_objectives: A `tf.Tensor` representing the multiple objectives to be
          scalarized.
        params: A dictionary from parameter names to parameter values (`Sequence` or
          `tf.Tensor`).
  
      Raises:
        tf.errors.InvalidArgumentError: if any scalarization parameter is not a 1-D
          tensor or `Sequence`, and has shape that does not match the shape of
          `multi_objectives`.
      """
      for param_name, param_value in params.items():
          param_shape = tf.convert_to_tensor(param_value).shape
          if (
              param_shape.rank != 1
              and not multi_objectives.shape.is_compatible_with(
                  param_shape
              )
          ):
              raise ValueError(
                  "The shape of multi_objectives: {} does not match the shape of "
                  "scalarization parameter: {}, which is {}".format(
                      multi_objectives.shape, param_name, param_shape
                  )
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import copy
  from typing import Callable, Dict, NamedTuple, Optional, Sequence, Union
  import numpy
  import six
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_scalarization_parameter_shape(multi_objectives, params) without return types