code: def test_sum_keepdims():
      rng = tl.check_random_state(0)
      random_matrix = tl.tensor(rng.random_sample((10, 20)))
  
      summed_matrix1 = tl.sum(random_matrix, axis=0)
      assert tl.shape(summed_matrix1) == (20,)
      summed_matrix2 = tl.sum(random_matrix, axis=0, keepdims=False)
      assert tl.shape(summed_matrix2) == (20,)
      summed_matrix3 = tl.sum(random_matrix, axis=0, keepdims=True)
      assert tl.shape(summed_matrix3) == (1, 20)
  
      summed_matrix4 = tl.sum(random_matrix, axis=1)
      assert tl.shape(summed_matrix4) == (10,)
      summed_matrix5 = tl.sum(random_matrix, axis=1, keepdims=False)
      assert tl.shape(summed_matrix5) == (10,)
      summed_matrix6 = tl.sum(random_matrix, axis=1, keepdims=True)
      assert tl.shape(summed_matrix6) == (10, 1)
  
      # Third order tensor
      random_tensor = tl.tensor(rng.random_sample((10, 20, 30)))
  
      summed_tensor1 = tl.sum(random_tensor, axis=0)
      assert tl.shape(summed_tensor1) == (20, 30)
      summed_tensor2 = tl.sum(random_tensor, axis=0, keepdims=False)
      assert tl.shape(summed_tensor2) == (20, 30)
      summed_tensor3 = tl.sum(random_tensor, axis=0, keepdims=True)
      assert tl.shape(summed_tensor3) == (1, 20, 30)
  
      summed_tensor4 = tl.sum(random_tensor, axis=1)
      assert tl.shape(summed_tensor4) == (10, 30)
      summed_tensor5 = tl.sum(random_tensor, axis=1, keepdims=False)
      assert tl.shape(summed_tensor5) == (10, 30)
      summed_tensor6 = tl.sum(random_tensor, axis=1, keepdims=True)
      assert tl.shape(summed_tensor6) == (10, 1, 30)
  
      summed_tensor7 = tl.sum(random_tensor, axis=2)
      assert tl.shape(summed_tensor7) == (10, 20)
      summed_tensor8 = tl.sum(random_tensor, axis=2, keepdims=False)
      assert tl.shape(summed_tensor8) == (10, 20)
      summed_tensor9 = tl.sum(random_tensor, axis=2, keepdims=True)
      assert tl.shape(summed_tensor9) == (10, 20, 1)
  
imports: from concurrent.futures import ThreadPoolExecutor
  import pytest
  from time import time
  import numpy
  from scipy.linalg import svd
  from scipy import special
  import tensorly
  from ..None import backend
  from ..testing import assert_allclose, assert_array_equal, assert_equal, assert_, assert_array_almost_equal, assert_raises
  from tensorly.tenalg.svd import SVD_FUNS, svd_interface
label_desc: Use image node_id 20 for calling a global function with example usage: test_sum_keepdims() without return types