code: def test_from_4D_image_with_unknown_shape():
      for shape in (2, 4), (2, 4, 1), (1, 2, 4, 1):
          exp = tf.ones(shape=shape)
          fn = tf.function(
              img_utils.from_4D_image
          ).get_concrete_function(
              tf.TensorSpec(shape=None, dtype=tf.float32),
              tf.size(shape),
          )
          res = fn(tf.ones(shape=(1, 2, 4, 1)), tf.size(shape))
          np.testing.assert_equal(exp.numpy(), res.numpy())
  
file_path: addons/tensorflow_addons/image/tests/utils_test.py
imports: import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.image import utils
label_desc: Use image node_id 6 for calling a global function with example usage: test_from_4D_image_with_unknown_shape() without return types