code: def backward_hook_factory(buffer: list):
      def hook_func(
          module: torch.nn.Module,
          grad_input: torch.Tensor,
          grad_output: torch.Tensor,
      ):
          buffer.append(True)
  
      return hook_func
  
file_path: nni/test/algo/compression/utils/test_evaluator.py
imports: from __future__ import annotations
  import pytest
  import torch
  from nni.compression.utils.evaluator import TensorHook, ForwardHook, BackwardHook
  from ..assets.device import device
  from ..assets.simple_mnist import SimpleLightningModel, SimpleTorchModel, create_lighting_evaluator, create_pytorch_evaluator
label_desc: Use image node_id 6 for calling a global function with example usage: backward_hook_factory(buffer) and returns: hook_func