code: def _tile_nd(cls, op, val):
      # if more than 3d, we will rechunk the tensor into square chunk
      # on the diagonal direction
      in_tensor = op.input
      nsplits = [tuple(np.array(split)) for split in in_tensor.nsplits]
      if len(set(nsplits)) != 1:
          # need rechunk
          nsplit = decide_unify_split(*in_tensor.nsplits)
          in_tensor = yield from recursive_tile(
              in_tensor.rechunk(
                  tuple(nsplit for _ in range(in_tensor.ndim))
              )
          )
      cum_sizes = [0] + np.cumsum(in_tensor.nsplits[0]).tolist()
  
      out_chunks = []
      for chunk in in_tensor.chunks:
          if len(set(chunk.index)) == 1:
              # chunk on the diagonal direction
              chunk_op = op.copy().reset_key()
              chunk_op._k = 0
              chunk_inputs = [chunk]
              chunk_val = cls._gen_val(val, chunk.index[0], cum_sizes)
              if len(op.inputs) == 2:
                  chunk_inputs.append(chunk_val)
              chunk_op._val = chunk_val
              out_chunk = chunk_op.new_chunk(
                  chunk_inputs,
                  shape=chunk.shape,
                  order=chunk.order,
                  index=chunk.index,
              )
              out_chunks.append(out_chunk)
          else:
              out_chunks.append(chunk)
  
      out = op.outputs[0]
      new_op = op.copy()
      return new_op.new_tensors(
          op.inputs,
          shape=out.shape,
          order=out.order,
          chunks=out_chunks,
          nsplits=in_tensor.nsplits,
      )
  
imports: import numpy
  from ...None import opcodes
  from ...core import ENTITY_TYPE, recursive_tile
  from ...serialization.serializables import KeyField, AnyField, BoolField, Int32Field
  from ...utils import has_unknown_shape, ceildiv
  from ..operands import TensorOperand, TensorOperandMixin
  from ..datasource import tensor
  from ..array_utils import as_same_device, device
  from ..core import Tensor, TENSOR_TYPE
  from ..utils import decide_unify_split
label_desc: Use image node_id 11 for calling the TensorFillDiagonal obj's underlying member method code with example usage: obj._tile_nd(cls, op, val) and returns: new_op