code: def sparsity_3D(tensor):
      """Filter-wise sparsity for 4D tensors"""
      if tensor.dim() != 4:
          return 0
      l1_norms = distiller.norms.filters_lp_norm(
          tensor, p=1, length_normalized=False
      )
      num_nonzero_filters = len(torch.nonzero(l1_norms))
      num_filters = tensor.size(0)
      return 1 - num_nonzero_filters / num_filters
  
imports: import argparse
  from collections import OrderedDict
  from copy import deepcopy
  import logging
  import operator
  import random
  import numpy
  import torch
  import torch.nn
  import torch.backends.cudnn
  import yaml
  import inspect
label_desc: Use image node_id 14 for calling a global function with example usage: sparsity_3D(tensor) and returns: unknown, int