code: def _load_pretrained_weights(new_layer, previous_layer):
      "Load pretrained weights based on number of input channels"
      n_in = getattr(new_layer, "in_channels")
      if n_in == 1:
          # we take the sum
          new_layer.weight.data = previous_layer.weight.data.sum(
              dim=1, keepdim=True
          )
      elif n_in == 2:
          # we take first 2 channels + 50%
          new_layer.weight.data = (
              previous_layer.weight.data[:, :2] * 1.5
          )
      else:
          # keep 3 channels weights and set others to null
          new_layer.weight.data[:, :3] = previous_layer.weight.data
          new_layer.weight.data[:, 3:].zero_()
  
imports: from __future__ import annotations
  from packaging.version import parse
  from ..basics import *
  from .core import *
  from .data import *
  from .augment import *
  from .None import models
  import torchvision
  from ..callback.hook import num_features_model
label_desc: Use image node_id 4 for calling a global function with example usage: _load_pretrained_weights(new_layer, previous_layer) without return types