code: def _compute_l2_norm(val, eps):
      shape = val.shape
      rank = len(shape)
      batch_dims = rank - 3
      if batch_dims == 0:
          square_sum = np.sum(val**2)
          output = val / np.power(square_sum + eps, 0.5)
      else:
          batch_dim_prod = np.prod(shape[:batch_dims])
          reshape_val = np.reshape(val, (batch_dim_prod, -1))
          square_sum = (
              np.sum(reshape_val * reshape_val, axis=1, keepdims=True)
              + eps
          )
          output = reshape_val / np.power(square_sum, 0.5)
          output = np.reshape(output, shape)
      return output
  
imports: import itertools
  import platform
  import numpy
  import pytest
  import coremltools
  from coremltools._deps import _HAS_TF_2, _HAS_TORCH, MSG_TF2_NOT_FOUND, MSG_TORCH_NOT_FOUND
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, get_new_symbol, types
  from coremltools.converters.mil.mil.ops.tests.iOS14 import backends
  from coremltools.converters.mil.mil.ops.tests.testing_utils import UNK_SYM, construct_inputs_from_placeholders, run_compare_builder
  from coremltools.converters.mil.testing_reqs import compute_units
  from coremltools.converters.mil.testing_utils import random_gen
label_desc: Use image node_id 1 for calling the TestNormalizationL2Norm obj's underlying member method code with example usage: obj._compute_l2_norm(val, eps) and returns: output