code: def sharded_unembed_dim(
      vocab_size: int, shard_rank: int, num_shards: int
  ) -> int:
      """
      Utility method for determining the sharded vocab size of a sharded unembed parameter.
  
      Args:
          vocab_size (int): The size of the vocabulary.
          shard_rank (int): Which shard of the partitioned tensor to return.
          num_shards (int): The total number of shards the parameter is distributed across.
      """
      start_idx, end_idx = get_shard_endpoints(
          vocab_size, shard_rank, num_shards, granularity=1
      )
      return end_idx - start_idx
  
imports: import torch
  from .types import ShardingType
  from .utils import shard_param, get_shard_endpoints
label_desc: Use image node_id 2 for calling a global function with example usage: sharded_unembed_dim(vocab_size, shard_rank, num_shards) and returns: unknown