def METHOD_NAME(self, module, inputs, outputs):
    """Register backward hooks on input and output
    tensors of linear layers in the model."""
    inputs = _format_tensor_into_tuples(inputs)
    self._has_single_input = len(inputs) == 1
    self._handle_input_hooks = []
    for input in inputs:
        if not hasattr(input, "hook_registered"):
            input_hook = self._create_backward_hook_input(input.data)
            self._handle_input_hooks.append(input.register_hook(input_hook))
            input.hook_registered = True
    output_hook = self._create_backward_hook_output(outputs.data)
    self._handle_output_hook = outputs.register_hook(output_hook)
    return outputs.clone()