code: def bilinear_upsample_weights(factor, number_of_classes):
      filter_size = 2 * factor - factor % 2
      weights = np.zeros(
          (
              number_of_classes,
              number_of_classes,
              filter_size,
              filter_size,
          ),
          dtype=np.float32,
      )
  
      upsample_kernel = upsample_filt(filter_size)
  
      for i in range(number_of_classes):
          weights[i, i, :, :] = upsample_kernel
      return torch.Tensor(weights)
  
imports: import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: bilinear_upsample_weights(factor, number_of_classes) and returns: torch