code: def max(self, dim=None, keepdim=False, one_hot=True):
      """Returns the maximum value of all elements in the input tensor."""
      method = cfg.functions.max_method
      if dim is None:
          if method in ["log_reduction", "double_log_reduction"]:
              # max_result can be obtained directly
              max_result = _max_helper_all_tree_reductions(
                  self, method=method
              )
          else:
              # max_result needs to be obtained through argmax
              with cfg.temp_override({"functions.max_method": method}):
                  argmax_result = self.argmax(one_hot=True)
              max_result = self.mul(argmax_result).sum()
          return max_result
      else:
          argmax_result, max_result = _argmax_helper(
              self,
              dim=dim,
              one_hot=True,
              method=method,
              _return_max=True,
          )
          if max_result is None:
              max_result = (self * argmax_result).sum(
                  dim=dim, keepdim=keepdim
              )
          if keepdim:
              max_result = (
                  max_result.unsqueeze(dim)
                  if max_result.dim() < self.dim()
                  else max_result
              )
          if one_hot:
              return max_result, argmax_result
          else:
              return (
                  max_result,
                  _one_hot_to_index(
                      argmax_result, dim, keepdim, self.device
                  ),
              )
  
file_path: CrypTen/crypten/common/functions/maximum.py
imports: import math
  import crypten
  import torch
  from crypten.config import cfg
label_desc: Use image node_id 3 for calling a global function with example usage: max(dim, keepdim, one_hot) and returns: max_result, max_result,  argmax_result, max_result,  _one_hot_to_index