self._bounds[name][1].copy_(upper_bound)
elif (isinstance(lower_bound, int) or isinstance(lower_bound, float)) and \
(isinstance(upper_bound, int) or isinstance(upper_bound, float)):
self._bounds[name][0].fill_(lower_bound)
self._bounds[name][1].fill_(upper_bound)
else:
raise AttributeError("Unsupported argument types for parameter %s" % name)
return self
After Change
not (isinstance(upper_bound, int) or isinstance(upper_bound, float)):
raise AttributeError("Unsupported argument types for parameter %s" % name)
if name not in self._bounds:
self._bounds[name] = [None, None]
self._bounds[name][0] = lower_bound
self._bounds[name][1] = upper_bound
return self