code: def get_cuda_max_memory_allocations() -> int:
      """Get the `max_memory_allocated` for each cuda device"""
      return torch.tensor(
          [
              torch.cuda.max_memory_allocated(i)
              for i in range(torch.cuda.device_count())
          ]
      )
  
imports: import random
  from contextlib import contextmanager
  from typing import Generator
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: get_cuda_max_memory_allocations() and returns: torch