code: def alloc_storage(data: torch.Tensor, size: torch.Size) -> None:
      """Allocate storage for a tensor."""
      if data.storage().size() == size.numel():  # no need to reallocate
          return
      assert data.storage().size() == 0
      data.storage().resize_(size.numel())
  
file_path: ColossalAI/colossalai/legacy/zero/sharded_model/_utils.py
imports: from typing import Any, Callable, List, Tuple, Union
  import torch
  import torch.nn.functional
  from colossalai.legacy.zero.gemini.stateful_tensor import StatefulTensor
label_desc: Use image node_id 3 for calling a global function with example usage: alloc_storage(data, size) without return types