code: def copy_grad(target_link, source_link):
      """Copy gradients of a link to another link."""
      for target_param, source_param in zip(
          target_link.parameters(), source_link.parameters()
      ):
          assert target_param.shape == source_param.shape
          if source_param.grad is None:
              target_param.grad = None
          else:
              target_param.grad = source_param.grad.clone()
  
imports: import torch
label_desc: Use image node_id 3 for calling a global function with example usage: copy_grad(target_link, source_link) without return types