code: def structured_sparsity(weight: _torch.Tensor) -> _torch.Tensor:
      return weight.flatten(1).sum(1).eq(0.0).float().mean().item()
  
file_path: coremltools/coremltools/optimize/torch/pruning/_utils.py
imports: import logging
  from typing import List
  from typing import Optional
  from typing import Tuple
  from typing import cast
  import numpy
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: structured_sparsity(weight) and returns: weight