code: def apply_feature_processors_to_kjt(
      features: KeyedJaggedTensor,
      feature_processors: Dict[str, nn.Module],
  ) -> KeyedJaggedTensor:
      processed_weights = []
      features_dict = features.to_dict()
  
      for key in features.keys():
          jt = features_dict[key]
          if key in feature_processors:
              fp_jt = feature_processors[key](jt)
              processed_weights.append(fp_jt.weights())
          else:
              processed_weights.append(
                  torch.ones(
                      jt.values().shape[0], device=jt.values().device
                  ),
              )
  
      return KeyedJaggedTensor(
          keys=features.keys(),
          values=features.values(),
          weights=torch.cat(processed_weights)
          if processed_weights
          else features.weights_or_none(),
          lengths=features.lengths(),
          offsets=features._offsets,
          stride=features._stride,
          length_per_key=features._length_per_key,
          offset_per_key=features._offset_per_key,
          index_per_key=features._index_per_key,
      )
  
file_path: torchrec/torchrec/modules/fp_embedding_modules.py
imports: from typing import Dict, List, Set, Union
  import torch
  import torch.nn
  from torchrec.modules.embedding_modules import EmbeddingBagCollection
  from torchrec.modules.feature_processor_ import FeatureProcessor, FeatureProcessorsCollection
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor, KeyedTensor
label_desc: Use image node_id 1 for calling a global function with example usage: apply_feature_processors_to_kjt(features, feature_processors) and returns: KeyedJaggedTensor