code: def test_multi_mode_dot_tensorly_2(shape):
      print(shape)
      X = ivy.ones(shape)
      vecs = [ivy.ones(s) for s in shape]
      res = ivy.multi_mode_dot(X, vecs)
      # result should be a scalar
      assert ivy.shape(res) == ()
      assert np.allclose(res, np.prod(shape))
  
      # Average pooling each mode
      # Order should not matter
      vecs = [vecs[i] / s for i, s in enumerate(shape)]
      for modes in itertools.permutations(range(len(shape))):
          res = ivy.multi_mode_dot(
              X, [vecs[i] for i in modes], modes=modes
          )
          assert ivy.shape(res) == ()
          assert np.allclose(res, 1)
  
imports: import math
  from hypothesis import strategies
  from hypothesis import assume
  import numpy
  import pytest
  import itertools
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test, BackendHandler
  import ivy
label_desc: Use image node_id 46 for calling a global function with example usage: test_multi_mode_dot_tensorly_2(shape) without return types