(self, module_class)
Register a module.

        Args:
            module (:obj:`nn.Module`): Module to be registered.
Register a module.
Register a module .
def _register_module(self, module_class):
        """Register a module.

        Args:
            module (:obj:`nn.Module`): Module to be registered.
        """
        if not inspect.isclass(module_class):
            raise TypeError('module must be a class, but got {}'.format(
                type(module_class)))
        module_name = module_class.__name__
        if module_name in self._module_dict:
            raise KeyError('{} is already registered in {}'.format(
                module_name, self.name))
        self._module_dict[module_name] = module_class
def _register_module ( self , module_class ) : if not inspect . isclass ( module_class ) : raise TypeError ( 'module must be a class, but got {}' . format ( type ( module_class ) ) ) module_name = module_class . __name__ if module_name in self . _module_dict : raise KeyError ( '{} is already registered in {}' . format ( module_name , self . name ) ) self . _module_dict [ module_name ] = module_class