class_docstr: # Special thanks to @raoyongming for the help to this function
class_docstr_tok: ["#","Special","thanks","to","@","raoyongming","for","the","help","to","this","function"]
code: def backward(ctx, grad_output):
      # grad_output = grad_output.detach_()
      fold = ctx.fold_
      n, t, _, h, w = grad_output.size()
      buffer = grad_output.data.new(n, t, fold, h, w).zero_()
      buffer[:, 1:] = grad_output.data[:, :-1, :fold]
      grad_output.data[:, :, :fold] = buffer
      buffer.zero_()
      buffer[:, :-1] = grad_output.data[:, 1:, fold : 2 * fold]
      grad_output.data[:, :, fold : 2 * fold] = buffer
      return grad_output, None
  
file_path: towhee/towhee/models/tsm/temporal_shift.py
imports: import torch
  from torch import nn
  import torch.nn.functional
  import torchvision
label_desc: Use image node_id 2 for calling the InplaceShift obj's underlying member method code with example usage: obj.backward(ctx, grad_output) and returns: grad_output,  None