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)
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)
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
def _setitem(self, key, value): if isinstance(value, Variable): add_role(value, PARAMETER) add_annotation(value, self.brick)