code: def tile(cls, op):
      y_true, y_pred = op.y_true, op.y_pred
      if isinstance(y_true, ENTITY_TYPE):
          y_true = mt.tensor(y_true)
      if isinstance(y_pred, ENTITY_TYPE):
          y_pred = mt.tensor(y_pred)
  
      if len(op.inputs) == 0:
          # no entity input
          type_true, y_true, y_pred = sklearn_check_targets(
              y_true, y_pred
          )
          new_op = op.copy()
          outs = yield from recursive_tile(
              mt.tensor(type_true), mt.tensor(y_true), mt.tensor(y_pred)
          )
          params = [out.params.copy() for out in op.outputs]
          for param, out in zip(params, outs):
              param["nsplits"] = out.nsplits
              param["chunks"] = out.chunks
              param["shape"] = out.shape
          return new_op.new_tileables(op.inputs, kws=params)
  
      check_consistent_length(y_true, y_pred)
  
      type_true, type_pred = type_of_target(y_true), type_of_target(
          y_pred
      )
      y_true, y_pred = mt.tensor(y_true), mt.tensor(y_pred)
      tileables = (
          y_true,
          y_pred,
          type_true,
          type_pred,
      ) = yield from recursive_tile(
          y_true, y_pred, type_true, type_pred
      )
      yield [c for t in tileables for c in t.chunks]
  
      ctx = get_context()
      type_true, type_pred = [
          d.item() if hasattr(d, "item") else d
          for d in ctx.get_chunks_result(
              [type_true.chunks[0].key, type_pred.chunks[0].key]
          )
      ]
  
      y_type = {type_true, type_pred}
      if y_type == {"binary", "multiclass"}:
          y_type = {"multiclass"}
  
      if len(y_type) > 1:
          raise ValueError(
              f"Classification metrics can't handle a mix of {type_true} "
              f"and {type_pred} targets"
          )
  
      # We can't have more than one value on y_type => The set is no more needed
      y_type = y_type.pop()
  
      # No metrics support "multiclass-multioutput" format
      if y_type not in ["binary", "multiclass", "multilabel-indicator"]:
          raise ValueError(f"{y_type} is not supported")
  
      if y_type in ["binary", "multiclass"]:
          y_true = column_or_1d(y_true)
          y_pred = column_or_1d(y_pred)
          if y_type == "binary":
              unique_values = mt.union1d(y_true, y_pred)
              y_type = mt.where(
                  mt.count_nonzero(unique_values) > 2,
                  "multiclass",
                  y_type,
              )
      elif y_type.startswith("multilabel"):
          y_true = mt.tensor(y_true).tosparse()
          y_pred = mt.tensor(y_pred).tosparse()
          y_type = "multilabel-indicator"
  
      if not isinstance(y_true, ENTITY_TYPE):
          y_true = mt.tensor(y_true)
      if not isinstance(y_pred, ENTITY_TYPE):
          y_pred = mt.tensor(y_pred)
      if not isinstance(y_type, TENSOR_TYPE):
          y_type = mt.tensor(y_type, dtype=object)
  
      y_type, y_true, y_pred = yield from recursive_tile(
          y_type, y_true, y_pred
      )
  
      kws = [out.params for out in op.outputs]
      kws[0].update(dict(nsplits=(), chunks=[y_type.chunks[0]]))
      kws[1].update(
          dict(
              nsplits=y_true.nsplits,
              chunks=y_true.chunks,
              shape=tuple(sum(sp) for sp in y_true.nsplits),
          )
      )
      kws[2].update(
          dict(
              nsplits=y_pred.nsplits,
              chunks=y_pred.chunks,
              shape=tuple(sum(sp) for sp in y_pred.nsplits),
          )
      )
      new_op = op.copy()
      return new_op.new_tileables(op.inputs, kws=kws)
  
file_path: mars/mars/learn/metrics/_check_targets.py
imports: import numpy
  from ...None import opcodes
  from ...None import tensor
  from ...core import ENTITY_TYPE, ExecutableTuple, recursive_tile
  from ...core.context import get_context
  from ...serialization.serializables import AnyField
  from ...tensor.core import TENSOR_TYPE, TensorOrder
  from ..operands import LearnOperand, LearnOperandMixin, OutputType
  from ..utils.multiclass import type_of_target
  from ..utils import check_consistent_length, column_or_1d
label_desc: Use image node_id 4 for calling the CheckTargets obj's underlying member method code with example usage: obj.tile(cls, op) and returns: new_op, new_op