code: def get_sharded(self, tensor_name: str, dim: int):
      filename, tensor_name = self.get_filename(tensor_name)
      f = self._get_handle(filename)
      slice_ = f.get_slice(tensor_name)
      world_size = self.process_group.size()
      size = slice_.get_shape()[dim]
      assert (
          size % world_size == 0
      ), f"The choosen size {size} is not compatible with sharding on {world_size} shards"
      return self.get_partial_sharded(tensor_name, dim)
  
imports: import os
  from pathlib import Path
  from typing import List, Dict, Optional, Tuple
  from safetensors import safe_open, SafetensorError
  import torch
  from loguru import logger
  from huggingface_hub import hf_hub_download
  import json
  from text_generation_server.utils.log import log_once
label_desc: Use image node_id 8 for calling the Weights obj's underlying member method code with example usage: obj.get_sharded(tensor_name, dim) and returns: self