code: def test_average_tensors():
      n = 4
      shape = (12, 14)
      arrays = [pt.rand(12, 14) for _ in range(n)]
      expected_average = pt.zeros(*shape)
      for array in arrays:
          expected_average += array
      expected_average /= 4
  
      pt.testing.assert_close(
          utils.average_tensors(arrays), expected_average
      )
  
      with pytest.raises(utils.SockeyeError) as e:
          other_shape = (12, 13)
          utils.average_tensors(arrays + [pt.zeros(*other_shape)])
      assert "tensor shapes do not match" == str(e.value)
  
imports: import gzip
  import math
  import os
  import re
  from tempfile import TemporaryDirectory
  import unittest
  import numpy
  import pytest
  import torch
  from sockeye import __version__
  from sockeye import constants
  from sockeye import utils
label_desc: Use image node_id 14 for calling a global function with example usage: test_average_tensors() without return types