code: def _load_regular_chunk(
      sharded_tensor: ShardedTensor, checkpoint_dir: Path
  ):
      assert isinstance(sharded_tensor, ShardedTensor), type(
          sharded_tensor
      )
      arr = open_ts_array(checkpoint_dir / sharded_tensor.key)
      if sharded_tensor.global_shape == arr.shape:
          x = (
              arr[sharded_tensor.global_slice()].read().result()
          )  # flattened tensors loading is delayed
      elif sharded_tensor.allow_shape_mismatch:
          global_slice = merge_global_slice_with_shape(
              sharded_tensor.global_slice(),
              arr.shape,
              sharded_tensor.key,
          )
          x = (
              arr[global_slice].read().result()
          )  # flattened tensors loading is delayed
      else:
          _msg = (
              f"Global shape mismatch for loaded ({arr.shape})"
              f" and expected ({sharded_tensor.global_shape}) tensor"
              f" for key {sharded_tensor.key}"
          )
          raise CheckpointingException(_msg)
      return x
  
imports: from functools import partial
  from itertools import starmap
  from logging import getLogger
  from pathlib import Path
  import tensorstore
  import torch
  from ..core import CheckpointingException
  from ..dict_utils import dict_list_map_inplace
  from ..mapping import ShardedStateDict, ShardedTensor
  from .base import LoadShardedStrategy, StrategyAction, default_strategies
  from .zarr import load_zarr_based_sharded_metadata, numpy_to_torch_dtype_dict, postprocess_numpy_array
label_desc: Use image node_id 3 for calling a global function with example usage: _load_regular_chunk(sharded_tensor, checkpoint_dir) and returns: x