megengine.amp.GradScaler.update

GradScaler.update(new_scale=None)[源代码]

Update the scale factor according to whether encountered overflow grad. If new_scale is provided, internal update mechanism will be ignored.