class_docstr: Apply linear transformations on heterogeneous inputs.
  
  Parameters
  ----------
  in_size : dict[key, int]
      Input feature size for heterogeneous inputs. A key can be a string or a tuple of strings.
  out_size : int
      Output feature size.
  bias : bool, optional
      If True, learns a bias term. Defaults: ``True``.
  
  Examples
  --------
  
  >>> import dgl
  >>> import torch
  >>> from dgl.nn import HeteroLinear
  
  >>> layer = HeteroLinear({'user': 1, ('user', 'follows', 'user'): 2}, 3)
  >>> in_feats = {'user': torch.randn(2, 1), ('user', 'follows', 'user'): torch.randn(3, 2)}
  >>> out_feats = layer(in_feats)
  >>> print(out_feats['user'].shape)
  torch.Size([2, 3])
  >>> print(out_feats[('user', 'follows', 'user')].shape)
  torch.Size([3, 3])
class_docstr_tok: ["Apply","linear","transformations","on","heterogeneous","inputs",".","Parameters","--","--","--","--","--","in_size",":","dict","[","key",",","int","]","Input","feature","size","for","heterogeneous","inputs",".","A","key","can","be","a","string","or","a","tuple","of","strings",".","out_size",":","int","Output","feature","size",".","bias",":","bool",",","optional","If","True",",","learns","a","bias","term",".","Defaults",":","``","True","``",".","Examples","--","--","--","--",">",">",">","import","dgl",">",">",">","import","torch",">",">",">","from","dgl.nn","import","HeteroLinear",">",">",">","layer","=","HeteroLinear","(","{","'user","'",":","1",",","(","'user","'",",","'follows","'",",","'user","'",")",":","2","}",",","3",")",">",">",">","in_feats","=","{","'user","'",":","torch.randn","(","2",",","1",")",",","(","'user","'",",","'follows","'",",","'user","'",")",":","torch.randn","(","3",",","2",")","}",">",">",">","out_feats","=","layer","(","in_feats",")",">",">",">","print","(","out_feats","[","'user","'","]",".shape",")","torch.Size","(","[","2",",","3","]",")",">",">",">","print","(","out_feats","[","(","'user","'",",","'follows","'",",","'user","'",")","]",".shape",")","torch.Size","(","[","3",",","3","]",")"]
code: def __init__(self, in_size, out_size, bias=True):
      super(HeteroLinear, self).__init__()
  
      self.linears = nn.ModuleDict()
      for typ, typ_in_size in in_size.items():
          self.linears[str(typ)] = nn.Linear(
              typ_in_size, out_size, bias=bias
          )
  
imports: from functools import partial
  import torch
  import torch.nn
  from ...base import DGLError
label_desc: Use image node_id 1 to create a new HeteroLinear object from inherited base classes: nn with example: obj = HeteroLinear(in_size, out_size, bias)