示例#1
0
 def add_auxiliary_variable(self, variable, roles=None, name=None):
     if name:
         variable.name = _variable_name(self.application.brick.name,
                                        self.application.name, name)
         variable.tag.name = name
         name = None
     add_annotation(variable, self.application.brick)
     return super(ApplicationCall,
                  self).add_auxiliary_variable(variable, roles, name)
示例#2
0
文件: base.py 项目: EloiZ/DeepCube
 def add_auxiliary_variable(self, variable, roles=None, name=None):
     if name:
         variable.name = _variable_name(
             self.application.brick.name, self.application.name, name)
         variable.tag.name = name
         name = None
     add_annotation(variable, self.application.brick)
     return super(ApplicationCall, self).add_auxiliary_variable(
         variable, roles, name)
示例#3
0
 def copy_and_tag(variable, role, name):
     """Helper method to copy a variable and annotate it."""
     copy = variable.copy()
     # Theano name
     copy.name = _variable_name(brick.name, self.name, name)
     add_annotation(copy, brick)
     add_annotation(copy, call)
     # Blocks name
     copy.tag.name = name
     add_role(copy, role)
     return copy
示例#4
0
文件: base.py 项目: EloiZ/DeepCube
 def copy_and_tag(variable, role, name):
     """Helper method to copy a variable and annotate it."""
     copy = variable.copy()
     # Theano name
     copy.name = _variable_name(brick.name, self.name, name)
     add_annotation(copy, brick)
     add_annotation(copy, call)
     # Blocks name
     copy.tag.name = name
     add_role(copy, role)
     return copy
示例#5
0
 def _setitem(self, key, value):
     if isinstance(value, Variable):
         add_role(value, PARAMETER)
         add_annotation(value, self.brick)
示例#6
0
文件: base.py 项目: EloiZ/DeepCube
 def _setitem(self, key, value):
     if isinstance(value, Variable):
         add_role(value, PARAMETER)
         add_annotation(value, self.brick)