code: def min(input: DTensor, *args, **kwargs):
      dim = None
      if len(args) > 0:
          dim = args[0]
      if "dim" in kwargs:
          dim = kwargs["dim"]
      keepdim = kwargs.get("keepdim", False)
      if dim is None:
          if "keepdim" in kwargs:
              raise TypeError(
                  f"min() received an invalid combination of arguments - got (Tensor, keepdim=bool), but expected one of\n"
                  "* (Tensor input)\n"
                  "* (Tensor input, tuple of ints dim, bool keepdim)\n"
                  "* (Tensor input, tuple of names dim, bool keepdim)"
              )
          else:
              return input.shardings.map_reduce_shard(
                  lambda x: torch.min(x),
                  lambda x, y: torch.minimum(x, y),
              )
  
      if input.shardings.shapes.axis == dim:
  
          def _mapper(stride: int, _: int, x: torch.Tensor):
              r = torch.min(x, dim=dim, keepdim=keepdim)
              return (
                  stride,
                  torch.return_types.min(
                      (r.values, r.indices + stride)
                  ),
              )
  
          def _reducer(
              kv1: Tuple[int, torch.return_types.min],
              kv2: Tuple[int, torch.return_types.min],
          ):
              s1, r1 = kv1
              s2, r2 = kv2
              s1, r1, s2, r2 = (
                  (s1, r1, s2, r2) if s1 < s2 else (s2, r2, s1, r1)
              )
              values = torch.minimum(r1.values, r2.values)
              indices = torch.add(
                  torch.mul(r1.indices, torch.le(r1.values, r2.values)),
                  torch.mul(r2.indices, torch.gt(r1.values, r2.values)),
              )
              return (s1, torch.return_types.min((values, indices)))
  
          return input.shardings.map_reduce_shard_with_stride(
              _mapper, _reducer
          )[1]
  
      values = DTensor(
          input.shardings.map_shard(
              lambda x: torch.min(x, dim=dim, keepdim=keepdim).values,
              shapes=input.shardings.shapes.squeeze(
                  (dim,), keepdim=keepdim
              ),
          )
      )
      indices = DTensor(
          input.shardings.map_shard(
              lambda x: torch.min(x, dim=dim, keepdim=keepdim).indices,
              shapes=input.shardings.shapes.squeeze(
                  (dim,), keepdim=keepdim
              ),
          )
      )
      return torch.return_types.min((values, indices))
  
file_path: FATE/python/fate/arch/tensor/distributed/_ops_agg.py
imports: from typing import Tuple
  import torch
  from ._tensor import DTensor, implements
label_desc: Use image node_id 5 for calling a global function with example usage: min(input) and returns: torch, input, input, stride,  torch, s1,  torch