code: def _rank3_trace(x: Tensor) -> Tensor:
      return torch.einsum("ijj->i", x)
  
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: _rank3_trace(x) and returns: torch