code: def get_upsampling_weight(in_channels, out_channels, kernel_size):
      factor = (kernel_size + 1) // 2
      if kernel_size % 2 == 1:
          center = factor - 1
      else:
          center = factor - 0.5
      og = np.ogrid[:kernel_size, :kernel_size]
      filt = (1 - abs(og[0] - center) / factor) * (
          1 - abs(og[1] - center) / factor
      )
      weight = np.zeros(
          (in_channels, out_channels, kernel_size, kernel_size),
          dtype=np.float64,
      )
      weight[
          list(range(in_channels)), list(range(out_channels)), :, :
      ] = filt
      return torch.from_numpy(weight).float()
  
imports: import os
  from math import ceil
  import numpy
  import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 3 for calling a global function with example usage: get_upsampling_weight(in_channels, out_channels, kernel_size) and returns: torch