code: def seed(seed_state, device="all"):
      """Seeds the random number generators in MXNet.
  
      This affects the behavior of modules in MXNet that uses random number generators,
      like the dropout operator and `NDArray`'s random sampling operators.
  
      Parameters
      ----------
      seed_state : int
          The random number seed.
  
      device : Device
          The device context of the generator. The default is "all" which means seeding random
          number generators of all devices.
  
      Notes
      -----
      Random number generators in MXNet are device specific.
      `mx.random.seed(seed_state)` sets the state of each generator using `seed_state` and the
      device id. Therefore, random numbers generated from different devices can be different
      even if they are seeded using the same seed.
  
      To produce identical random number sequences independent of the device id,
      set optional `device` argument. This produces the same sequence of random numbers independent
      of the device id, but the sequence can be different on different kind of devices as MXNet's
      random number generators for CPU and GPU use different algorithms.
  
      Example
      -------
      >>> print(mx.np.random.normal(shape=(2,2)).asnumpy())
      [[ 1.36481571 -0.62203991]
       [-1.4962182  -0.08511394]]
      >>> print(mx.np.random.normal(shape=(2,2)).asnumpy())
      [[ 1.09544981 -0.20014545]
       [-0.20808885  0.2527658 ]]
      # Same results on the same device with the same seed
      >>> mx.np.random.seed(128)
      >>> print(mx.np.random.normal(shape=(2,2)).asnumpy())
      [[ 0.47400656 -0.75213492]
       [ 0.20251541  0.95352972]]
      >>> mx.np.random.seed(128)
      >>> print(mx.np.random.normal(shape=(2,2)).asnumpy())
      [[ 0.47400656 -0.75213492]
       [ 0.20251541  0.95352972]]
      # Different results on gpu(0) and gpu(1) with the same seed
      >>> mx.np.random.seed(128)
      >>> print(mx.np.random.normal(shape=(2,2), device=mx.gpu(0)).asnumpy())
      [[ 2.5020072 -1.6884501]
       [-0.7931333 -1.4218881]]
      >>> mx.np.random.seed(128)
      >>> print(mx.np.random.normal(shape=(2,2), device=mx.gpu(1)).asnumpy())
      [[ 0.24336822 -1.664805  ]
       [-1.0223296   1.253198  ]]
      # Seeding with `device` argument produces identical results on gpu(0) and gpu(1)
      >>> mx.np.random.seed(128, device=mx.gpu(0))
      >>> print(mx.np.random.normal(shape=(2,2), device=mx.gpu(0)).asnumpy())
      [[ 2.5020072 -1.6884501]
       [-0.7931333 -1.4218881]]
      >>> mx.np.random.seed(128, device=mx.gpu(1))
      >>> print(mx.np.random.normal(shape=(2,2), device=mx.gpu(1)).asnumpy())
      [[ 2.5020072 -1.6884501]
       [-0.7931333 -1.4218881]]
      """
      if not isinstance(seed_state, integer_types):
          raise ValueError("seed_state must be int")
      seed_state = ctypes.c_int(int(seed_state))
      if device == "all":
          check_call(_LIB.MXRandomSeed(seed_state))
      else:
          device = Device(device)
          check_call(
              _LIB.MXRandomSeedContext(
                  seed_state, device.device_typeid, device.device_id
              )
          )
  
imports: import ctypes
  from .base import _LIB, check_call, integer_types
  from .ndarray.random import *
  from .device import Device
  from .util import wrap_ctx_to_device_func
label_desc: Use image node_id 1 for calling a global function with example usage: seed(seed_state, device) without return types