torch.nn.modules.module — PyTorch 1.10.1 documentation
pytorch.org › docs › stableThe child module can be accessed from this module using the given name module (Module): child module to be added to the module. """ if not isinstance (module, Module) and module is not None: raise TypeError (" {} is not a Module subclass". format (torch. typename (module))) elif not isinstance (name, torch. _six. string_classes): raise TypeError ("module name should be a string.
Module — PyTorch 1.10.1 documentation
pytorch.org › generated › torchname ( string) – name of the child module. The child module can be accessed from this module using the given name. module ( Module) – child module to be added to the module. apply(fn) [source] Applies fn recursively to every submodule (as returned by .children () ) as well as self.