code: def test_stack_execution(setup):
      raw = [np.random.randn(3, 4) for _ in range(10)]
      arrs = [tensor(a, chunk_size=3) for a in raw]
  
      arr2 = stack(arrs)
      res = arr2.execute().fetch()
      assert np.array_equal(res, np.stack(raw)) is True
  
      arr3 = stack(arrs, axis=1)
      res = arr3.execute().fetch()
      assert np.array_equal(res, np.stack(raw, axis=1)) is True
  
      arr4 = stack(arrs, axis=2)
      res = arr4.execute().fetch()
      assert np.array_equal(res, np.stack(raw, axis=2)) is True
  
      raw2 = [
          np.asfortranarray(np.random.randn(3, 4)) for _ in range(10)
      ]
      arr5 = [tensor(a, chunk_size=3) for a in raw2]
  
      arr6 = stack(arr5)
      res = arr6.execute().fetch()
      expected = np.stack(raw2).copy("A")
      np.testing.assert_array_equal(res, expected)
  
      arr7 = stack(arr5, out=empty((10, 3, 4), order="F"))
      res = arr7.execute().fetch()
      expected = np.stack(
          raw2, out=np.empty((10, 3, 4), order="F")
      ).copy("A")
      np.testing.assert_array_equal(res, expected)
      assert res.flags["C_CONTIGUOUS"] == expected.flags["C_CONTIGUOUS"]
      assert res.flags["F_CONTIGUOUS"] == expected.flags["F_CONTIGUOUS"]
  
      # test stack with unknown shapes
      t = tensor(raw[0], chunk_size=3)
      t2 = t[t[:, 0] > 0.0]
      t3 = t2 + 1
  
      arr8 = stack([t2, t3])
      result = arr8.execute().fetch()
      e = raw[0]
      e2 = e[e[:, 0] > 0.0]
      e3 = e2 + 1
      np.testing.assert_array_equal(result, np.stack([e2, e3]))
  
file_path: mars/mars/tensor/merge/tests/test_merge_execution.py
imports: import numpy
  import scipy.sparse
  import pytest
  from ...datasource import tensor, empty, eye, ones, zeros
  from ...None import concatenate, stack, hstack, vstack, dstack, column_stack, union1d, array, block, append
label_desc: Use image node_id 2 for calling a global function with example usage: test_stack_execution(setup) without return types