docstr: Reduce tensors to a destination gpu following options.
  
  Args:
      tensors: the list of tensors to be reduced, each tensor
                      must reside on one gpu of the current process.
      reduce_options: reduce options.
  
  Returns:
      None
docstr_tok: ["Reduce","tensors","to","a","destination","gpu","following","options",".","Args",":","tensors",":","the","list","of","tensors","to","be","reduced",",","each","tensor","must","reside","on","one","gpu","of","the","current","process",".","reduce_options",":","reduce","options",".","Returns",":","None"]
code: def reduce(self, tensors, reduce_options=ReduceOptions()):
      """Reduce tensors to a destination gpu following options.
  
      Args:
          tensors: the list of tensors to be reduced, each tensor
                          must reside on one gpu of the current process.
          reduce_options: reduce options.
  
      Returns:
          None
      """
      root_rank = (
          len(tensors) * reduce_options.root_rank
          + reduce_options.root_tensor
      )
  
      def collective_fn(input_tensor, output_tensor, comm, stream):
          comm.reduce(
              nccl_util.get_tensor_ptr(input_tensor),
              nccl_util.get_tensor_ptr(output_tensor),
              nccl_util.get_tensor_n_elements(input_tensor),
              nccl_util.get_nccl_tensor_dtype(input_tensor),
              nccl_util.get_nccl_reduce_op(reduce_options.reduceOp),
              root_rank,
              stream.ptr,
          )
  
      self._collective(tensors, tensors, collective_fn)
  
imports: import logging
  import datetime
  import time
  import ray
  import cupy
  from ray.util.collective.const import ENV
  from ray.util.collective.collective_group import nccl_util
  from ray.util.collective.collective_group.base_collective_group import BaseGroup
  from ray.util.collective.const import get_store_name
  from ray.util.collective.types import AllReduceOptions, BarrierOptions, Backend, ReduceOptions, BroadcastOptions, AllGatherOptions, ReduceScatterOptions, SendOptions, RecvOptions
  from ray.util.collective.collective_group.cuda_stream import get_stream_pool
label_desc: Use image node_id 6 for calling the NCCLGroup obj's underlying member method code with example usage: obj.reduce(tensors, reduce_options) without return types