code: def sharded_intermediate_dim(
      intermediate_size: int, num_shards: int, shard_rank: int
  ) -> int:
      """
      Utility method for getting the size of the intermediate dimension of a sharded MLP.
  
      Args:
          intermediate_size (int): The size of the intermediate dimension.
          num_shards (int): The total number of shards the parameter is distributed across.
          shard_rank (int): Which shard of the partitioned tensor to return.
      """
      endpoints = get_shard_endpoints(
          intermediate_size, shard_rank, num_shards
      )
      return endpoints[1] - endpoints[0]
  
imports: from typing import Optional
  import torch
  from .types import ShardingType, DEFAULT_SHARD_GRANULARITY
  from .utils import shard_param, get_shard_endpoints
label_desc: Use image node_id 3 for calling a global function with example usage: sharded_intermediate_dim(intermediate_size, num_shards, shard_rank) and returns: unknown