code: def test_add():
      t1 = ones((3, 4), chunk_size=2)
      t2 = ones(4, chunk_size=2)
      t3 = t1 + t2
      k1 = t3.key
      assert t3.op.gpu is None
      t1, t2, t3 = tile(t1, t2, t3)
      assert t3.key != k1
      assert t3.shape == (3, 4)
      assert len(t3.chunks) == 4
      assert t3.chunks[0].inputs == [
          t1.chunks[0].data,
          t2.chunks[0].data,
      ]
      assert t3.chunks[1].inputs == [
          t1.chunks[1].data,
          t2.chunks[1].data,
      ]
      assert t3.chunks[2].inputs == [
          t1.chunks[2].data,
          t2.chunks[0].data,
      ]
      assert t3.chunks[3].inputs == [
          t1.chunks[3].data,
          t2.chunks[1].data,
      ]
      assert t3.op.dtype == np.dtype("f8")
      assert t3.chunks[0].op.dtype == np.dtype("f8")
  
      t1 = ones((3, 4), chunk_size=2)
      t4 = t1 + 1
      t1, t4 = tile(t1, t4)
      assert t4.shape == (3, 4)
      assert len(t3.chunks) == 4
      assert t4.chunks[0].inputs == [t1.chunks[0].data]
      assert t4.chunks[0].op.rhs == 1
      assert t4.chunks[1].inputs == [t1.chunks[1].data]
      assert t4.chunks[1].op.rhs == 1
      assert t4.chunks[2].inputs == [t1.chunks[2].data]
      assert t4.chunks[2].op.rhs == 1
      assert t4.chunks[3].inputs == [t1.chunks[3].data]
      assert t4.chunks[3].op.rhs == 1
  
      t5 = add([1, 2, 3, 4], 1)
      tile(t5)
      assert t4.chunks[0].inputs == [t1.chunks[0].data]
  
      t2 = ones(4, chunk_size=2)
      t6 = ones((3, 4), chunk_size=2, gpu=True)
      t7 = ones(4, chunk_size=2, gpu=True)
      t8 = t6 + t7
      t9 = t6 + t2
      assert t8.op.gpu is True
      t8, t9 = tile(t8, t9)
      assert t8.chunks[0].op.gpu is True
      assert t9.op.gpu is None
      assert t9.chunks[0].op.gpu is None
  
      # sparse tests
      t1 = tensor([[0, 1, 0], [1, 0, 0]], chunk_size=2).tosparse()
  
      t = t1 + 1
      assert t.op.gpu is None
      assert t.issparse() is True
      assert type(t) is SparseTensor
  
      t = tile(t)
      assert t.chunks[0].op.sparse is True
  
      t = t1 + 0
      assert t.issparse() is True
      assert type(t) is SparseTensor
  
      t2 = tensor([[1, 0, 0]], chunk_size=2).tosparse()
  
      t = t1 + t2
      assert t.issparse() is True
      assert type(t) is SparseTensor
  
      t = tile(t)
      assert t.chunks[0].op.sparse is True
  
      t3 = tensor([1, 1, 1], chunk_size=2)
      t = t1 + t3
      assert t.issparse() is False
      assert type(t) is Tensor
  
      t = tile(t)
      assert t.chunks[0].op.sparse is False
  
imports: import numpy
  import pytest
  import scipy.sparse
  from ....core import enter_mode, tile
  from ...datasource import array, ones, tensor, empty
  from ...fetch import TensorFetch
  from ...linalg import matmul
  from ...core import Tensor, SparseTensor
  from ..None import add, subtract, truediv, log, frexp, around, isclose, isfinite, negative, cos, tree_add, tree_multiply, TensorAdd, TensorTreeAdd, TensorTreeMultiply, TensorSubtract, TensorLog, TensorIsclose, TensorGreaterThan
label_desc: Use image node_id 1 for calling a global function with example usage: test_add() without return types