class_docstr: Sharded implementation of `QuantEmbeddingCollection`.
class_docstr_tok: ["Sharded","implementation","of","`","QuantEmbeddingCollection","`","."]
code: def _generate_permute_coordinates_per_feature_per_sharding(
      self,
  ) -> None:
      key_to_feature_permuted_coordinates_per_sharding: List[
          Dict[str, List[Tuple[int, int]]]
      ] = [
          {}
          for i in range(
              len(self._embedding_names_per_rank_per_sharding)
          )
      ]
  
      for idx, embedding_names_per_rank in enumerate(
          self._embedding_names_per_rank_per_sharding
      ):
          for rank, embedding_names in enumerate(
              embedding_names_per_rank
          ):
              for idx_in_rank, embedding_name in enumerate(
                  embedding_names
              ):
                  if (
                      embedding_name
                      not in key_to_feature_permuted_coordinates_per_sharding[
                          idx
                      ]
                  ):
                      key_to_feature_permuted_coordinates_per_sharding[
                          idx
                      ][embedding_name] = torch.jit.annotate(
                          List[Tuple[int, int]], []
                      )
                  key_to_feature_permuted_coordinates_per_sharding[idx][
                      embedding_name
                  ].append((rank, idx_in_rank))
  
          for (
              key,
              coordinates,
          ) in key_to_feature_permuted_coordinates_per_sharding[
              idx
          ].items():
              permuted_coordinates: List[Tuple[int, int]] = coordinates
  
              if key in self._features_to_permute_indices:
                  permuted_coordinates = [(-1, -1)] * len(coordinates)
                  permute_indices: List[
                      int
                  ] = self._features_to_permute_indices[key].tolist()
                  for i, permute_idx in enumerate(permute_indices):
                      permuted_coordinates[i] = coordinates[permute_idx]
              self._key_to_feature_permuted_coordinates_per_sharding[
                  idx
              ][key] = torch.tensor(permuted_coordinates)
  
imports: from collections import defaultdict, deque
  from dataclasses import dataclass
  from typing import Any, cast, Dict, List, Optional, Tuple, Type
  import torch
  from fbgemm_gpu.split_table_batched_embeddings_ops_inference import IntNBitTableBatchedEmbeddingBagsCodegen
  from torch import nn
  from torchrec.distributed.embedding import create_sharding_infos_by_sharding, EmbeddingShardingInfo
  from torchrec.distributed.embedding_sharding import EmbeddingSharding
  from torchrec.distributed.embedding_types import BaseQuantEmbeddingSharder, FeatureShardingMixIn, GroupedEmbeddingConfig, KJTList, ListOfKJTList, ShardingType
  from torchrec.distributed.fused_params import FUSED_PARAM_QUANT_STATE_DICT_SPLIT_SCALE_BIAS, FUSED_PARAM_REGISTER_TBE_BOOL, get_tbes_to_register_from_iterable, is_fused_param_quant_state_dict_split_scale_bias, is_fused_param_register_tbe
  from torchrec.distributed.quant_state import ShardedQuantEmbeddingModuleState
  from torchrec.distributed.sharding.cw_sequence_sharding import InferCwSequenceEmbeddingSharding
  from torchrec.distributed.sharding.rw_sequence_sharding import InferRwSequenceEmbeddingSharding
  from torchrec.distributed.sharding.rw_sharding import InferRwSparseFeaturesDist
  from torchrec.distributed.sharding.sequence_sharding import InferSequenceShardingContext
  from torchrec.distributed.sharding.tw_sequence_sharding import InferTwSequenceEmbeddingSharding
  from torchrec.distributed.types import ParameterSharding, ShardingEnv, ShardMetadata
  from torchrec.modules.embedding_configs import data_type_to_sparse_type, dtype_to_data_type, EmbeddingConfig
  from torchrec.quant.embedding_modules import EmbeddingCollection, MODULE_ATTR_QUANT_STATE_DICT_SPLIT_SCALE_BIAS
  from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor
  from torchrec.streamable import Multistreamable
label_desc: Use image node_id 6 for calling the ShardedQuantEmbeddingCollection obj's underlying member method code with example usage: obj._generate_permute_coordinates_per_feature_per_sharding() without return types