code: def stack(mems):
      """
      Stack a list of tensors
      Could use torch.stack here but torch.stack is much slower
      than torch.cat + view
      Submitted an issue for investigation:
      https://github.com/pytorch/pytorch/issues/22462
  
      FIXME: Remove this function after the issue above is resolved
      """
      shape = (-1, *mems[0].shape)
      return torch.cat(mems).view(*shape)
  
file_path: ReAgent/reagent/core/torch_utils.py
imports: from io import BytesIO
  from typing import Dict, List
  import numpy
  import torch
  from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor
label_desc: Use image node_id 3 for calling a global function with example usage: stack(mems) and returns: torch