parameters: (remote_module)
return_statement: return (
          _remote_module_receiver,
          tuple(pickled_attrs.values()),
      )
docstring: Serializes a RemoteModule.
docstring_summary: Serializes a RemoteModule.
docstring_tokens: Serializes a RemoteModule .
function: def _remote_module_reducer(remote_module):
      """
      Serializes a RemoteModule.
      """
      pickled_attrs = {}
      for k, v in remote_module.__dict__.items():
          # Pickling the attribute `module_rref` must invoke RRef's `_serialize()` method.
          if k == "module_rref":
              pickled_attrs[k] = v._serialize()
          elif k in _REMOTE_MODULE_PICKLED_ATTRIBUTES:
              pickled_attrs[k] = v
          # Check if unpickled attributes are all in _REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING.
          elif k not in _REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING:
              print(
                  "The new attribute ``{}`` of RemoteModule is ignored during RPC pickling. "
                  "To pickle this attribute, please add it to ``_REMOTE_MODULE_PICKLED_ATTRIBUTES``. "
                  "Otherwise, please explicitly add it to ``_REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING``.".format(
                      k
                  ),
                  file=sys.stderr,
              )
  
      return (
          _remote_module_receiver,
          tuple(pickled_attrs.values()),
      )
function_tokens: def _remote_module_reducer ( remote_module ) : pickled_attrs = { } for k , v in remote_module . __dict__ . items ( ) : # Pickling the attribute `module_rref` must invoke RRef's `_serialize()` method. if k == "module_rref" : pickled_attrs [ k ] = v . _serialize ( ) elif k in _REMOTE_MODULE_PICKLED_ATTRIBUTES : pickled_attrs [ k ] = v # Check if unpickled attributes are all in _REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING. elif k not in _REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING : print ( "The new attribute ``{}`` of RemoteModule is ignored during RPC pickling. " "To pickle this attribute, please add it to ``_REMOTE_MODULE_PICKLED_ATTRIBUTES``. " "Otherwise, please explicitly add it to ``_REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING``." . format ( k ) , file = sys . stderr , ) return ( _remote_module_receiver , tuple ( pickled_attrs . values ( ) ) , )