code: def _apply_dense(self, X):
      X_tensor = X
      n_samples = X.shape[0]
      out = ivy.zeros(n_samples, dtype="int32")
      for i in range(n_samples):
          node = self.nodes[0]  # root node
          while node.left_child != _TREE_LEAF:
              X_i_node_feature = X_tensor[i, node.feature]
              if ivy.isnan(X_i_node_feature):
                  if node.missing_go_to_left:
                      node = self.nodes[node.left_child]
                  else:
                      node = self.nodes[node.right_child]
              elif X_i_node_feature <= node.threshold:
                  node = self.nodes[node.left_child]
              else:
                  node = self.nodes[node.right_child]
          out[i] = self.nodes.index(node)  # terminal node index
      return out
  
file_path: ivy/ivy/functional/frontends/sklearn/tree/_tree.py
imports: import ivy
  from ._splitter import SplitRecord
label_desc: Use image node_id 7 for calling the Tree obj's underlying member method code with example usage: obj._apply_dense(X) and returns: out