code: def _as_tensor(x: Tuple[int, int]) -> torch.Tensor:
      """
      An equivalent of `torch.as_tensor`, but works under tracing if input
      is a list of tensor. `torch.as_tensor` will record a constant in tracing,
      but this function will use `torch.stack` instead.
      """
      if torch.jit.is_scripting():
          return torch.as_tensor(x)
      if isinstance(x, (list, tuple)) and all(
          isinstance(t, torch.Tensor) for t in x
      ):
          return torch.stack(x)
      return torch.as_tensor(x)
  
file_path: vissl/vissl/data/collators/collator_helper.py
imports: from typing import List, Tuple
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: _as_tensor(x) and returns: torch, torch, torch