code: def forward(
      self,
      x: Union[Tensor, Dict[Union[NodeType, EdgeType], Tensor]],
      type_vec: Optional[Tensor] = None,
  ) -> Union[Tensor, Dict[Union[NodeType, EdgeType], Tensor]]:
      if isinstance(x, dict):
          return self.dict_forward(x)
  
      elif isinstance(x, Tensor) and type_vec is not None:
          return self.fused_forward(x, type_vec)
  
      raise ValueError(
          f"Encountered invalid forward types in "
          f"'{self.__class__.__name__}'"
      )
  
imports: import copy
  import warnings
  from typing import Dict, List, Optional, Union
  import torch
  import torch.nn.functional
  from torch import Tensor
  import torch_geometric
  from torch_geometric import is_compiling
  from torch_geometric.typing import EdgeType, NodeType, OptTensor
  from torch_geometric.utils import cumsum, scatter
label_desc: Use image node_id 4 for calling the ToHeteroLinear obj's underlying member method code with example usage: obj.forward(x, type_vec) and returns: self, self