code: def _render_tensor(
      tensor, *, new_line: str = "\n", indent: str = "", depth=0
  ):
      if len(tensor) > 5:
          truncated = True
          idx = [0, 1, 2, "...", len(tensor) - 1]
      else:
          truncated = False
          idx = [i for i in range(len(tensor))]
  
      res = [indent, "["]
      if depth >= 2:
          new_line = ""
      else:
          new_line = new_line
  
      if new_line == "\n":
          current_indent = " " + indent
      else:
          indent = ""
          current_indent = ""
      if len(tensor.shape) > 1:
          res.append(new_line)
          for i in idx:
              if i == "...":
                  res.append(current_indent)
                  res.append("...")
              else:
                  sub_res, sub_trunc = _render_tensor(
                      tensor[i],
                      new_line=new_line,
                      indent=current_indent,
                      depth=depth + 1,
                  )
                  truncated = truncated or sub_trunc
                  res += sub_res
              if i != idx[-1]:
                  res.append(", ")
              res.append(new_line)
      else:
          for i in idx:
              if i == "...":
                  res.append("...")
              else:
                  res += [_format_value(tensor[i])]
              if i != idx[-1]:
                  res.append(", ")
  
      res.append(indent)
      res.append("]")
  
      return res, truncated
  
imports: import collections
  import math
  from typing import TYPE_CHECKING, List, Tuple
  from labml.internal.util.colors import StyleCode
  from ....logger import Text
label_desc: Use image node_id 7 for calling a global function with example usage: _render_tensor(tensor) and returns: res,  truncated