code: def test_add_with_out():
      t1 = ones((3, 4), chunk_size=2)
      t2 = ones(4, chunk_size=2)
  
      t3 = add(t1, t2, out=t1)
  
      assert isinstance(t1.op, TensorAdd)
      assert t1.op.out.key == t1.op.lhs.key
      assert t3 is t1
      assert t3.shape == (3, 4)
      assert t3.op.lhs.extra_params.raw_chunk_size == 2
      assert t3.op.rhs is t2.data
      assert t3.key != t3.op.lhs.key
  
      t1, t3 = tile(t1, t3)
  
      assert isinstance(t1.chunks[0].op, TensorAdd)
      assert t1.chunks[0].op.out.key == t1.chunks[0].op.lhs.key
  
      with pytest.raises(TypeError):
          add(t1, t2, out=1)
  
      with pytest.raises(ValueError):
          add(t1, t2, out=t2)
  
      with pytest.raises(TypeError):
          truediv(t1, t2, out=t1.astype("i8"))
  
      t1 = ones((3, 4), chunk_size=2, dtype=float)
      t2 = ones(4, chunk_size=2, dtype=int)
  
      t3 = add(t2, 1, out=t1)
      assert t3.shape == (3, 4)
      assert t3.dtype == np.float64
  
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 6 for calling a global function with example usage: test_add_with_out() without return types