class_docstr: Wraps a module. When forward() is called, passes kwargs that require_grad through torch.checkpoint() and bypasses
  checkpoint for all other args.
class_docstr_tok: ["Wraps","a","module",".","When","forward","(",")","is","called",",","passes","kwargs","that","require_grad","through","torch.checkpoint","(",")","and","bypasses","checkpoint","for","all","other","args","."]
code: def forward(self, x, *args, **kwargs):
      for k, v in kwargs.items():
          assert not (
              isinstance(v, torch.Tensor) and v.requires_grad
          )  # This would screw up checkpointing.
      partial = functools.partial(self.wrap, **kwargs)
      return partial(x, *args)
  
imports: import functools
  import math
  import os
  import fsspec
  import torch
  import torch.nn
  import torch.nn.functional
  import torchaudio
  from transformers import LogitsWarper
  from TTS.tts.layers.tortoise.xtransformers import ContinuousTransformerWrapper, RelativePositionBias
label_desc: Use image node_id 2 for calling the CheckpointedLayer obj's underlying member method code with example usage: obj.forward(x) and returns: partial