code: def _max_helper_accelerated_cascade(enc_tensor, dim=None):
      """Returns max along dimension `dim` using the accelerated cascading algorithm"""
      if enc_tensor.dim() == 0:
          return enc_tensor
      input, dim_used = enc_tensor, dim
      if dim is None:
          dim_used = 0
          input = enc_tensor.flatten()
      n = input.size(dim_used)  # number of items in the dimension
      if n < 3:
          with cfg.temp_override({"functions.max_method": "pairwise"}):
              enc_max, enc_argmax = enc_tensor.max(dim=dim_used)
              return enc_max
      steps = int(math.log(math.log(math.log(n)))) + 1
      enc_tensor_reduced = _compute_pairwise_comparisons_for_steps(
          enc_tensor, dim_used, steps
      )
      enc_max = _max_helper_double_log_reduction(
          enc_tensor_reduced, dim=dim_used
      )
      return enc_max
  
file_path: FATE/python/fate/arch/protocol/mpc/functions/maximum.py
imports: import math
  import torch
  from fate.arch.protocol import mpc
  from fate.arch.protocol.mpc.config import cfg
label_desc: Use image node_id 10 for calling a global function with example usage: _max_helper_accelerated_cascade(enc_tensor, dim) and returns: enc_max, enc_tensor, enc_max