torch
    Preparing search index...

    Function no_grad

    • Execute fn with gradient computation disabled. The previous grad mode is always restored, even if fn throws.

      Type Parameters

      • T

      Parameters

      • fn: () => T

      Returns T