class_docstr: Applies separate linear tranformations to the incoming data dictionary.
  
  For key :math:`\kappa`, it computes
  
  .. math::
      \mathbf{x}^{\prime}_{\kappa} = \mathbf{x}_{\kappa}
      \mathbf{W}^{\top}_{\kappa} + \mathbf{b}_{\kappa}.
  
  It supports lazy initialization and customizable weight and bias
  initialization.
  
  Args:
      in_channels (int or Dict[Any, int]): Size of each input sample. If
          passed an integer, :obj:`types` will be a mandatory argument.
          initialized lazily in case it is given as :obj:`-1`.
      out_channels (int): Size of each output sample.
      types (List[Any], optional): The keys of the input dictionary.
          (default: :obj:`None`)
      **kwargs (optional): Additional arguments of
          :class:`torch_geometric.nn.Linear`.
class_docstr_tok: ["Applies","separate","linear","tranformations","to","the","incoming","data","dictionary",".","For","key",":","math",":","`","\\kappa","`",",","it","computes","..","math",":",":","\\mathbf","{","x","}","^","{","\\prime","}","_","{","\\kappa","}","=","\\mathbf","{","x","}","_","{","\\kappa","}","\\mathbf","{","W","}","^","{","\\top","}","_","{","\\kappa","}","+","\\mathbf","{","b","}","_","{","\\kappa","}",".","It","supports","lazy","initialization","and","customizable","weight","and","bias","initialization",".","Args",":","in_channels","(","int","or","Dict","[","Any",",","int","]",")",":","Size","of","each","input","sample",".","If","passed","an","integer",",",":","obj",":","`","types","`","will","be","a","mandatory","argument",".","initialized","lazily","in","case","it","is","given","as",":","obj",":","`","-1","`",".","out_channels","(","int",")",":","Size","of","each","output","sample",".","types","(","List","[","Any","]",",","optional",")",":","The","keys","of","the","input","dictionary",".","(","default",":",":","obj",":","`","None","`",")","*","*","kwargs","(","optional",")",":","Additional","arguments","of",":","class",":","`","torch_geometric.nn.Linear","`","."]
code: def __init__(
      self,
      in_channels: Union[int, Dict[Any, int]],
      out_channels: int,
      types: Optional[Any] = None,
      **kwargs,
  ):
      super().__init__()
  
      if isinstance(in_channels, dict):
          self.types = list(in_channels.keys())
  
          if any([i == -1 for i in in_channels.values()]):
              self._hook = self.register_forward_pre_hook(
                  self.initialize_parameters
              )
  
          if types is not None and set(self.types) != set(types):
              raise ValueError(
                  "The provided 'types' do not match with the "
                  "keys in the 'in_channels' dictionary"
              )
  
      else:
          if types is None:
              raise ValueError(
                  "Please provide a list of 'types' if passing "
                  "'in_channels' as an integer"
              )
  
          if in_channels == -1:
              self._hook = self.register_forward_pre_hook(
                  self.initialize_parameters
              )
  
          self.types = types
          in_channels = {node_type: in_channels for node_type in types}
  
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.kwargs = kwargs
  
      self.lins = torch.nn.ModuleDict(
          {
              key: Linear(channels, self.out_channels, **kwargs)
              for key, channels in self.in_channels.items()
          }
      )
  
      self.reset_parameters()
  
imports: import copy
  import math
  from typing import Any, Dict, Optional, Union
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch.nn.parameter import Parameter
  import torch_geometric.backend
  import torch_geometric.typing
  from torch_geometric import is_compiling
  from torch_geometric.nn import inits
  from torch_geometric.typing import pyg_lib
  from torch_geometric.utils import index_sort, scatter
  from torch_geometric.utils.sparse import index2ptr
label_desc: Use image node_id 1 to create a new HeteroDictLinear object from inherited base classes: torch.nn with example: obj = HeteroDictLinear(in_channels, out_channels, types)