code: def test_triu_tril():
      a_data = np.arange(12).reshape(4, 3)
      a = tensor(a_data, chunk_size=2)
  
      t = triu(a)
  
      assert t.op.gpu is None
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorTriu)
      assert isinstance(t.chunks[1].op, TensorTriu)
      assert isinstance(t.chunks[2].op, TensorZeros)
      assert isinstance(t.chunks[3].op, TensorTriu)
  
      t = triu(a, k=1)
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorTriu)
      assert isinstance(t.chunks[1].op, TensorTriu)
      assert isinstance(t.chunks[2].op, TensorZeros)
      assert isinstance(t.chunks[3].op, TensorZeros)
  
      t = triu(a, k=2)
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorZeros)
      assert isinstance(t.chunks[1].op, TensorTriu)
      assert isinstance(t.chunks[2].op, TensorZeros)
      assert isinstance(t.chunks[3].op, TensorZeros)
  
      t = triu(a, k=-1)
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorTriu)
      assert isinstance(t.chunks[1].op, TensorTriu)
      assert isinstance(t.chunks[2].op, TensorTriu)
      assert isinstance(t.chunks[3].op, TensorTriu)
  
      t = tril(a)
  
      assert t.op.gpu is None
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorTril)
      assert isinstance(t.chunks[1].op, TensorZeros)
      assert isinstance(t.chunks[2].op, TensorTril)
      assert isinstance(t.chunks[3].op, TensorTril)
  
      t = tril(a, k=1)
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorTril)
      assert isinstance(t.chunks[1].op, TensorTril)
      assert isinstance(t.chunks[2].op, TensorTril)
      assert isinstance(t.chunks[3].op, TensorTril)
  
      t = tril(a, k=-1)
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorTril)
      assert isinstance(t.chunks[1].op, TensorZeros)
      assert isinstance(t.chunks[2].op, TensorTril)
      assert isinstance(t.chunks[3].op, TensorTril)
  
      t = tril(a, k=-2)
  
      t = tile(t)
      assert len(t.chunks) == 4
      assert isinstance(t.chunks[0].op, TensorZeros)
      assert isinstance(t.chunks[1].op, TensorZeros)
      assert isinstance(t.chunks[2].op, TensorTril)
      assert isinstance(t.chunks[3].op, TensorZeros)
  
imports: import shutil
  import tempfile
  from copy import copy
  import numpy
  import scipy.sparse
  import pytest
  from ....None import dataframe
  from ....core import enter_mode, tile
  from ...None import ones, zeros, tensor, full, arange, diag, linspace, triu, tril, ones_like
  from ...core import Tensor, SparseTensor
  from ..None import array, fromtiledb, TensorTileDBDataSource, fromdense, asarray, ascontiguousarray, asfortranarray
  from ..tri import TensorTriu, TensorTril
  from ..zeros import TensorZeros
  from ..from_dense import DenseToSparse
  from ..array import CSRMatrixDataSource
  from ..ones import TensorOnes, TensorOnesLike
  from ..from_dataframe import from_dataframe
label_desc: Use image node_id 11 for calling a global function with example usage: test_triu_tril() without return types