code: def _batchwise_reduce_sum(x):
      with tf.name_scope("batchwise_reduce_sum"):
          return tf.reduce_sum(
              input_tensor=x, axis=tf.range(1, tf.rank(x))
          )
  
imports: import collections
  import functools
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python import random
  from tensorflow_probability.python.experimental import auto_batching
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.util.seed_stream import SeedStream
label_desc: Use image node_id 4 for calling a global function with example usage: _batchwise_reduce_sum(x) and returns: tf