code: def check_masks(
      masks: Dict[str, Dict[str, torch.Tensor]], model_type
  ):
      prefix = "model." if model_type == "lightning" else ""
      assert (
          1
          - masks[f"{prefix}conv1"]["weight"].sum()
          / masks[f"{prefix}conv1"]["weight"].numel()
          == 0.75
      )
      assert (
          1
          - masks[f"{prefix}conv2"]["weight"].sum()
          / masks[f"{prefix}conv2"]["weight"].numel()
          == 0.75
      )
      assert (
          1
          - masks[f"{prefix}conv3"]["weight"].sum()
          / masks[f"{prefix}conv3"]["weight"].numel()
          == 0.75
      )
      assert (
          1
          - masks[f"{prefix}fc1"]["weight"].sum()
          / masks[f"{prefix}fc1"]["weight"].numel()
          == 0.75
      )
  
      assert torch.equal(
          masks[f"{prefix}conv1"]["weight"]
          .sum([1, 2, 3])
          .bool()
          .float(),
          masks[f"{prefix}conv1"]["bias"],
      )
      assert torch.equal(
          masks[f"{prefix}conv2"]["weight"]
          .sum([1, 2, 3])
          .bool()
          .float(),
          masks[f"{prefix}conv2"]["bias"],
      )
      assert torch.equal(
          masks[f"{prefix}conv3"]["weight"]
          .sum([1, 2, 3])
          .bool()
          .float(),
          masks[f"{prefix}conv3"]["bias"],
      )
      assert torch.equal(
          masks[f"{prefix}fc1"]["weight"].sum([1]).bool().float(),
          masks[f"{prefix}fc1"]["bias"],
      )
      assert torch.equal(
          masks[f"{prefix}conv2"]["weight"]
          .sum([1, 2, 3])
          .bool()
          .float(),
          masks[f"{prefix}conv3"]["weight"]
          .sum([1, 2, 3])
          .bool()
          .float(),
      )
  
file_path: nni/test/algo/compression/pruning/test_pruner.py
imports: import pytest
  from typing import Dict, Type
  import torch
  from nni.compression.pruning import LevelPruner, L1NormPruner, L2NormPruner, FPGMPruner, SlimPruner, TaylorPruner, MovementPruner, LinearPruner, AGPPruner
  from nni.compression.base.compressor import Pruner
  from nni.compression.utils import auto_set_denpendency_group_ids
  from nni.compression.speedup import ModelSpeedup
  from ..assets.common import create_model
  from ..assets.simple_mnist import create_lighting_evaluator, create_pytorch_evaluator
label_desc: Use image node_id 1 for calling a global function with example usage: check_masks(masks, model_type) without return types