Assign the variable a new value.
(self, v)
| 76 | raise ValueError("{} is not a variable in the graph!".format(self.var_name)) |
| 77 | |
| 78 | def set_value(self, v): |
| 79 | """ Assign the variable a new value. """ |
| 80 | if not self.var.dtype.is_floating and isinstance(v, float): |
| 81 | raise ValueError( |
| 82 | "HyperParam {} has type '{}'. Cannot update it using float values.".format( |
| 83 | self.name, self.var.dtype)) |
| 84 | self.var.load(v) |
| 85 | |
| 86 | def get_value(self): |
| 87 | """ Evaluate the variable. """ |