コード例 #1
0
ファイル: module.py プロジェクト: NicolasBouchard/Theano
 def make(self, *args, **kwargs):
     """
     Allocates the necessary containers using allocate() and uses
     build() to make an instance which will be returned. The
     initialize() method of the instance will be called with the
     arguments and the keyword arguments. If 'mode' is in the
     keyword arguments it will be passed to build().
     """
     mode = kwargs.pop('mode', get_mode.get_default_mode())
     rval = self.make_no_init(mode)
     if hasattr(rval, 'initialize'):
         rval.initialize(*args, **kwargs)
     return rval
コード例 #2
0
ファイル: module.py プロジェクト: jsalvatier/Theano-1
 def make(self, *args, **kwargs):
     """
     Allocates the necessary containers using allocate() and uses
     build() to make an instance which will be returned. The
     initialize() method of the instance will be called with the
     arguments and the keyword arguments. If 'mode' is in the
     keyword arguments it will be passed to build().
     """
     mode = kwargs.pop('mode', get_mode.get_default_mode())
     rval = self.make_no_init(mode)
     if hasattr(rval, 'initialize'):
         rval.initialize(*args, **kwargs)
     return rval
コード例 #3
0
ファイル: module.py プロジェクト: NicolasBouchard/Theano
 def make_no_init(self, mode=None):
     """
     Allocates the necessary containers using allocate() and uses
     build() with the provided mode to make an instance which will
     be returned.  The initialize() method of the instance will not
     be called.
     """
     if mode is None:
         mode = get_mode.get_default_mode()
     memo = {}
     self.allocate(memo)
     rval = self.build(mode, memo)
     return rval
コード例 #4
0
ファイル: module.py プロジェクト: jsalvatier/Theano-1
 def make_no_init(self, mode=None):
     """
     Allocates the necessary containers using allocate() and uses
     build() with the provided mode to make an instance which will
     be returned.  The initialize() method of the instance will not
     be called.
     """
     if mode is None:
         mode = get_mode.get_default_mode()
     memo = {}
     self.allocate(memo)
     rval = self.build(mode, memo)
     return rval