(self, key: str, val, bn_groups: bool = True)
return val
Set `val` inside the optimizer dictionary at `key`.
Set `val` inside the optimizer dictionary at `key`.
Set val inside the optimizer dictionary at key .
def set_val(self, key: str, val, bn_groups: bool = True):
        "Set `val` inside the optimizer dictionary at `key`."
        if is_tuple(val): val = [(v1, v2) for v1, v2 in zip(*val)]
        for v, pg1, pg2 in zip(val, self.opt.param_groups[::2],
                               self.opt.param_groups[1::2]):
            pg1[key] = v
            if bn_groups: pg2[key] = v
        return val
def set_val ( self , key : str , val , bn_groups : bool = True ) : if is_tuple ( val ) : val = [ ( v1 , v2 ) for v1 , v2 in zip ( * val ) ] for v , pg1 , pg2 in zip ( val , self . opt . param_groups [ : : 2 ] , self . opt . param_groups [ 1 : : 2 ] ) : pg1 [ key ] = v if bn_groups : pg2 [ key ] = v return val