code: def fprop_and_bprop(bottleneck, x, dy):
      y = bottleneck(x)
      y.backward(dy)
      dgrad = x.grad.detach()
      wgrad = {}
      for n, p in bottleneck.named_parameters():
          wgrad[n] = p.grad.detach()
      return x, y, dy, dgrad, wgrad
  
imports: import unittest
  import torch
  from torch.testing._internal import common_utils
  from apex.transformer.testing.distributed_test_base import NcclDistributedTestBase
label_desc: Use image node_id 8 for calling a global function with example usage: fprop_and_bprop(bottleneck, x, dy) and returns: x,  y,  dy,  dgrad,  wgrad