code: def _find_max_depth(tree_parameters):
      """
      Function traversing all trees in sequence and returning the maximum depth.
      """
      depth = 0
  
      for tree in tree_parameters:
          tree = copy.deepcopy(tree)
  
          lefts = tree.lefts
          rights = tree.rights
  
          ids = [i for i in range(len(lefts))]
          nodes = list(zip(ids, lefts, rights))
  
          nodes_map = {0: Node(0)}
          current_node = 0
          for i, node in enumerate(nodes):
              id, left, right = node
  
              if left != -1:
                  l_node = Node(left)
                  nodes_map[left] = l_node
              else:
                  lefts[i] = id
                  l_node = -1
  
              if right != -1:
                  r_node = Node(right)
                  nodes_map[right] = r_node
              else:
                  rights[i] = id
                  r_node = -1
  
              nodes_map[current_node].left = l_node
              nodes_map[current_node].right = r_node
  
              current_node += 1
  
          depth = max(depth, _find_depth(nodes_map[0], -1))
  
      return depth
  
imports: import copy
  import numpy
  import torch
  from ._tree_implementations import TreeImpl
  from ._tree_implementations import GEMMDecisionTreeImpl, TreeTraversalDecisionTreeImpl, PerfectTreeTraversalDecisionTreeImpl
  from .None import constants
  from hummingbird.ml.exceptions import MissingConverter
label_desc: Use image node_id 1 for calling a global function with example usage: _find_max_depth(tree_parameters) and returns: depth