class_docstr: PS tables correspond to an EmbeddingCollection or EmbeddingBagCollection.
class_docstr_tok: ["PS","tables","correspond","to","an","EmbeddingCollection","or","EmbeddingBagCollection","."]
docstr: Args:
      path: module path.
      plan: dict keyed by table name of ParameterSharding and tensor of the table.
      url: configuration for PS, e.g. redis://127.0.0.1:6379/?prefix=model.
      ps_config: config of the PS, currently only support setting chunk size.
docstr_tok: ["Args",":","path",":","module","path",".","plan",":","dict","keyed","by","table","name","of","ParameterSharding","and","tensor","of","the","table",".","url",":","configuration","for","PS",",","e.g",".","redis",":","\/\/127.0.0.1:6379\/","?","prefix=model",".","ps_config",":","config","of","the","PS",",","currently","only","support","setting","chunk","size","."]
code: def __init__(
      self,
      path: str,
      plan: Dict[
          str,
          Tuple[ParameterSharding, Union[torch.Tensor, ShardedTensor]],
      ],
      url: Union[str, Callable[[str], str]],
      ps_config=None,
  ):
      """
      Args:
          path: module path.
          plan: dict keyed by table name of ParameterSharding and tensor of the table.
          url: configuration for PS, e.g. redis://127.0.0.1:6379/?prefix=model.
          ps_config: config of the PS, currently only support setting chunk size.
      """
      self._path = path
      self._ps_collection = {}
      chunk_size = DEFAULT_PS_CHUNK_SIZE
      if ps_config is not None and "chunk_size" in ps_config:
          chunk_size = ps_config["chunk_size"]
      for table_name, (param_plan, tensor) in plan.items():
          if isinstance(url, str):
              table_config = url
          else:
              table_config = url(table_name)
          self._ps_collection[table_name] = PS(
              f"{path}.{table_name}", tensor, table_config, chunk_size
          )
  
file_path: torchrec/contrib/dynamic_embedding/src/torchrec_dynamic_embedding/ps.py
imports: import os
  from typing import Callable, Dict, List, Tuple, Union
  import torch
  from torch.distributed._shard.sharded_tensor import ShardedTensor
  from torchrec.distributed.types import ParameterSharding
  from .tensor_list import TensorList
label_desc: Use image node_id 1 to create a new PSCollection object  with example: obj = PSCollection(path, plan, url, ps_config)