class_docstr: Adds position weights to id list features.
  
  Args:
      max_feature_lengths (Dict[str, int]): feature name to `max_length` mapping.
          `max_length`, a.k.a truncation size, specifies the maximum number of ids
          each sample has. For each feature, its position weight parameter size is
          `max_length`.
code: def __init__(
      self,
      max_feature_lengths: Dict[str, int],
      device: Optional[torch.device] = None,
  ) -> None:
      super().__init__()
      self.max_feature_lengths = max_feature_lengths
      self.position_weights: nn.ParameterDict = nn.ParameterDict()
      for key, length in max_feature_lengths.items():
          self.position_weights[key] = nn.Parameter(
              torch.empty([length], device=device)
          )
      self.reset_parameters()
  
imports: import abc
  from collections import OrderedDict
  from typing import Any, Dict, Iterator, List, Optional, Tuple
  import torch
  import torch.nn
  from torchrec.fx.tracer import is_fx_tracing
  from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor
label_desc: Use image node_id 1 to create a new PositionWeightedModule object from inherited base classes: BaseFeatureProcessor with example: obj = PositionWeightedModule(max_feature_lengths, device)