Initializes the module.

        Note that if the module has learned parameters, those will be
        reset.
12189
def initialize_module(self):
        
        kwargs = self._get_params_for('module')
        module = self.module
        is_initialized = isinstance(module, torch.nn.Module)

        if kwargs or not is_initialized:
            if is_initialized:
                module = type(module)

            if (is_initialized or self.initialized_) and self.verbose:
                msg = self._format_reinit_msg("module", kwargs)
                print(msg)

            module = module(**kwargs)

        self.module_ = module.to(self.device)
        return self
303603
protected void initModule() {

        Object o;
        CmsModule module;

        if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
            // this is the initial dialog call
            if (CmsStringUtil.isNotEmpty(m_paramModule)) {
                // edit an existing module, get it from manager
                o = OpenCms.getModuleManager().getModule(m_paramModule);
            } else {
                // create a new module
                o = null;
            }
        } else {
            // this is not the initial call, get module from session
            o = getDialogObject();
        }

        if (!(o instanceof CmsModule)) {
            // create a new module
            module = new CmsModule();

        } else {
            // reuse module stored in session
            module = (CmsModule)((CmsModule)o).clone();
        }

        List exportpoints = module.getExportPoints();
        m_exportpoint = new CmsExportPoint();
        if ((exportpoints != null) && (exportpoints.size() > 0)) {
            Iterator i = exportpoints.iterator();
            while (i.hasNext()) {
                CmsExportPoint exportpoint = (CmsExportPoint)i.next();
                if (exportpoint.getUri().equals(m_paramExportpoint)) {
                    m_exportpoint = exportpoint;
                }
            }
        }

    }
531654
def initialize_training(self, training_info: TrainingInfo, model_state=None, hidden_state=None):
        
        if model_state is None:
            self.model.reset_weights()
        else:
            self.model.load_state_dict(model_state)
1038502
public function init()
    {
        // Duplicated init protection
        if ($this->_blInit) {
            return;
        }
        $this->_blInit = true;

        $this->_loadVarsFromFile();
        $this->_setDefaults();
        $this->storedVarTypes = $this->getStoredVarTypes();

        try {
            $sShopID = $this->getShopId();
            $blConfigLoaded = $this->_loadVarsFromDb($sShopID);

            // loading shop config
            if (empty($sShopID) || !$blConfigLoaded) {
                throw oxNew(ConnectionException::class, "Unable to load shop config values from database");
            }

            // loading theme config options
            $this->_loadVarsFromDb(
                $sShopID, null, Config::OXMODULE_THEME_PREFIX . $this->getConfigParam('sTheme')
            );

            $this->_aConfigParamsParentTheme = $this->_aConfigParams;

            // checking if custom theme (which has defined parent theme) config options should be loaded over parent theme (#3362)
            if ($this->getConfigParam('sCustomTheme')) {
                $this->_loadVarsFromDb(
                    $sShopID, null, Config::OXMODULE_THEME_PREFIX . $this->getConfigParam('sCustomTheme')
                );
            }

            // loading modules config
            $this->_loadVarsFromDb($sShopID, null, Config::OXMODULE_MODULE_PREFIX);

            $aOnlyMainShopVars = array('blMallUsers', 'aSerials', 'IMD', 'IMA', 'IMS');
            $this->_loadVarsFromDb($this->getBaseShopId(), $aOnlyMainShopVars);
        } catch (ConnectionException $oEx) {
            $oEx->debugOut();
            Registry::getUtils()->showMessageAndExit($oEx->getString());
        }
    }
924954
public function init()
    {
        Profiler::start('moduleManager', 'init');
        $module = $this->load($this->directory, array(), true);
        if ($module) {
            $this->mainModule = $module;
            $this->add($module);
//            Profiler::start('moduleManager Init');
            $this->mainModule->init();
            $this->mainModule->register_events();
            if (isset($this->config['modules'])) {
                $this->loadConfig($this->config, $this->mainModule);
            }

            foreach ($this->modules as $module) {
                    $module->init();
                    $module->register_router($this->router);
            }
            foreach ($this->modules as $module) {
                if ($module !== $this->mainModule) {
                    $module->register_events();
                }
            }
//            dump($this->modules);
//            die();
//            Profiler::stop('moduleManager Init');
        } else {
            $file = $this->directory . "/config.yml";
            throw new \Exception('Can\'t not load the main module! Looking for: \'' . $file . '\'. folder 
            realpath: ' . realpath($this->directory));
        }
        Profiler::stop('moduleManager');
    }
76988
def initialize(self):
        
        super(Block, self).initialize()

        block = self.block

        if block: #: This block is setting the content of another block
            #: Remove the existing blocks children
            if self.mode == 'replace':
                #: Clear the blocks children
                for c in block.children:
                    c.destroy()
            #: Add this blocks children to the other block
            block.insert_children(None, self.children)

        else: #: This block is inserting it's children into it's parent
            self.parent.insert_children(self, self.children)
869257
private function initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            foreach ($params as $param) {
                if (self::CONTAINS_KEY === $param->getType()) {
                    $cont = new Contains();
                    $cont->setValue($param->getValue());
                    $this->contains[] = $cont;
                } elseif (self::NEGATE_KEY === $param->getType()) {
                    $this->setNegate(Project::toBoolean($param->getValue()));
                }
            }
        }
    }
71798
public function initializeInnerParameters()
    {
        $paramName = $this->config('name');
        $this->_dependentParameters[$paramName] = new HiddenParameter($this->_registry, [
            'name' => $paramName
        ]);
    }
848128
def init(module, db):
    
    for model in farine.discovery.import_models(module):
        model._meta.database = db
1316225
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $paramsCount = count($params); $i < $paramsCount; $i++) {
                if (self::COMMENTS_KEY === $params[$i]->getType()) {
                    $comment = new Comment();
                    $comment->setValue($params[$i]->getValue());
                    $this->_comments[] = $comment;
                }
            }
        }
    }
203280
def initialize_parameters(self, initializer: mx.init.Initializer, allow_missing_params: bool):
        
        self.module.init_params(initializer=initializer,
                                arg_params=self.params,
                                aux_params=self.aux_params,
                                allow_missing=allow_missing_params,
                                force_init=False)
281115
protected void init() {
		// Get all our messages
		objectSingularName = getApplicationConfig().messageResolver().getMessage(
				modelId + ".objectName.singular");
		objectPluralName = getApplicationConfig().messageResolver().getMessage(
				modelId + ".objectName.plural");
	}
1129742
public function init()
    {
        parent::init();
        $this->layout = $this->module->defaultLayout;
        $this->menu = $this->getSubMenu();
    }
1259417
@PostConstruct
  public void initialize() {

    if (this.initializationState.setInitializing()) {
      if (this.visibility == null) {
        this.visibility = VisibilityModifier.PUBLIC;
      }
      this.initializationState.setInitialized();
    }
  }
1148249
function initModule(forge) {

forge.mgf = forge.mgf || {};
forge.mgf.mgf1 = forge.mgf1;

}
903806
public function initialize()
    {
        parent::initialize();
        $this->loadComponent($this->plugin . '.Extension');
        $this->loadModel($this->plugin . '.Extensions');
    }
916894
public static function init()
    {
        foreach (self::$_modulePaths as $path) {
            $folder = new Folder($path);
            $modulePaths = $folder->read(true, false, true)[0];

            foreach ($modulePaths as $modulePath) {
                self::_initializeModule($modulePath);
            }
        }

        self::$_initialized = true;
    }