code: def _create_write_item_for_tensor(
      fqn: str, tensor: torch.Tensor
  ) -> WriteItem:
      offsets = torch.Size([0] * len(tensor.size()))
      return WriteItem(
          index=MetadataIndex(fqn, offsets),
          type=WriteItemType.TENSOR,
          tensor_data=TensorWriteData(
              chunk=ChunkStorageMetadata(
                  offsets=offsets, sizes=tensor.size()
              ),
              properties=TensorProperties.create_from_tensor(tensor),
              size=tensor.size(),
          ),
      )
  
imports: from typing import Any, cast, List
  import torch
  import torch.distributed
  from torch._utils import _get_device_module
  from torch.distributed._shard.metadata import ShardMetadata
  from torch.distributed._shard.sharded_tensor import ShardedTensor
  from torch.distributed._shard.sharded_tensor.metadata import TensorProperties
  from torch.distributed._tensor import DTensor
  from torch.distributed._tensor._utils import compute_local_shape_and_global_offset
  from torch.utils._pytree import tree_map_only
  from .metadata import BytesStorageMetadata, ChunkStorageMetadata, MetadataIndex, STATE_DICT_TYPE, STORAGE_TYPES, TensorStorageMetadata
  from .planner import LoadItemType, ReadItem, SavePlan, TensorWriteData, WriteItem, WriteItemType
  from .resharding import _check_shard_metadata_pair_overlap, _shards_get_overlap_region_wrt_saved_tensor
label_desc: Use image node_id 6 for calling a global function with example usage: _create_write_item_for_tensor(fqn, tensor) and returns: WriteItem