parameters: (seed)
return_statement: return core.default_cpu_generator().manual_seed(seed)
docstring: Sets the seed for global default generator, which manages the random number generation.
  
      Args:
          seed(int): The random seed to set. It is recommend to set a large int number.
  
      Returns:
          Generator: The global default generator object.
  
      Examples:
          .. code-block:: python
  
              import paddle
              gen = paddle.seed(102)
function: def seed(seed):
      """
  
      Sets the seed for global default generator, which manages the random number generation.
  
      Args:
          seed(int): The random seed to set. It is recommend to set a large int number.
  
      Returns:
          Generator: The global default generator object.
  
      Examples:
          .. code-block:: python
  
              import paddle
              gen = paddle.seed(102)
  
      """
      #TODO(zhiqiu): 1. remove program.random_seed when all random-related op upgrade
      # 2. support gpu generator by global device 
  
      seed = int(seed)
  
      if core.is_compiled_with_cuda():
          for i in range(core.get_cuda_device_count()):
              core.default_cuda_generator(i)._is_init_py = True
              core.default_cuda_generator(i).manual_seed(seed)
  
      core.default_cpu_generator()._is_init_py = True
      return core.default_cpu_generator().manual_seed(seed)
function_tokens: def seed ( seed ) : #TODO(zhiqiu): 1. remove program.random_seed when all random-related op upgrade # 2. support gpu generator by global device  seed = int ( seed ) if core . is_compiled_with_cuda ( ) : for i in range ( core . get_cuda_device_count ( ) ) : core . default_cuda_generator ( i ) . _is_init_py = True core . default_cuda_generator ( i ) . manual_seed ( seed ) core . default_cpu_generator ( ) . _is_init_py = True return core . default_cpu_generator ( ) . manual_seed ( seed )