code: def __init__(
      self,
      embs_dims: List[int],
      permute: List[int],
      device: Optional[torch.device] = None,
  ) -> None:
      logging.info("Using Permute Pooled Embeddings")
      self._offset_dim_list: torch.Tensor = torch.tensor(
          [0] + list(accumulate(embs_dims)),
          device=device,
          dtype=torch.int64,
      )
  
      self._permute: torch.Tensor = torch.tensor(
          permute, device=device, dtype=torch.int64
      )
  
      inv_permute: List[int] = [0] * len(permute)
      for i, p in enumerate(permute):
          inv_permute[p] = i
  
      self._inv_permute: torch.Tensor = torch.tensor(
          inv_permute, device=device, dtype=torch.int64
      )
  
      inv_embs_dims = [embs_dims[i] for i in permute]
  
      self._inv_offset_dim_list: torch.Tensor = torch.tensor(
          [0] + list(accumulate(inv_embs_dims)),
          device=device,
          dtype=torch.int64,
      )
  
imports: import copy
  import logging
  from collections import OrderedDict
  from itertools import accumulate
  from typing import Any, Dict, List, Optional, Set, Type, TypeVar, Union
  import torch
  from fbgemm_gpu.split_embedding_configs import EmbOptimType
  from torch import nn
  from torchrec import optim
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel
  from torchrec.distributed.types import DataType, ParameterSharding, ShardedModule, ShardingType
  from torchrec.modules.embedding_configs import data_type_to_sparse_type
  from torchrec.types import CopyMixIn
label_desc: Use image node_id 1 to create a new PermutePooledEmbeddings object  with example: obj = PermutePooledEmbeddings(embs_dims, permute, device)