Table Of Contents
Table Of Contents

pause

mxnet.autograd.pause(train_mode=False)[source]

Returns a scope context to be used in ‘with’ statement for codes that do not need gradients to be calculated.

Example:

with autograd.record():
    y = model(x)
    backward([y])
    with autograd.pause():
        # testing, IO, gradient updates...
Parameters:train_mode (bool, default False) – Whether to do forward for training or predicting.