code: def matmul(A: Optional[Tensor], B: Tensor) -> Tensor:
      """Multiply two matrices.
  
      If A is None, return B. A can be sparse or dense. B is always
      dense.
      """
      if A is None:
          return B
      if is_sparse(A):
          return torch.sparse.mm(A, B)
      return torch.matmul(A, B)
  
file_path: pytorch/torch/_linalg_utils.py
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: matmul(A, B) and returns: torch, B, torch