code: def _itemwise_error_rate(
      total_rate, param_tensors, samples_tensor=None, name=None
  ):
      """Distributes a total error rate for a batch of assertions."""
      with tf.name_scope(name or "itemwise_error_rate"):
          result_shape = [1]
          for p_tensor in param_tensors:
              result_shape = tf.broadcast_dynamic_shape(
                  tf.shape(p_tensor), result_shape
              )
          if samples_tensor is not None:
              result_shape = tf.broadcast_dynamic_shape(
                  tf.shape(samples_tensor)[1:], result_shape
              )
          num_items = tf.reduce_prod(result_shape)
          return total_rate / tf.cast(num_items, dtype=total_rate.dtype)
  
imports: import functools
  import itertools
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.util.seed_stream import SeedStream
label_desc: Use image node_id 18 for calling a global function with example usage: _itemwise_error_rate(total_rate, param_tensors, samples_tensor, name) and returns: unknown