class_docstr: Recsys model from "Deep Learning Recommendation Model for Personalization and
  Recommendation Systems" (https://arxiv.org/abs/1906.00091). Processes sparse
  features by learning pooled embeddings for each feature. Learns the relationship
  between dense features and sparse features by projecting dense features into the
  same embedding space. Also, learns the pairwise relationships between sparse
  features.
  
  The module assumes all sparse features have the same embedding dimension
  (i.e. each EmbeddingBagConfig uses the same embedding_dim).
  
  The following notation is used throughout the documentation for the models:
  
  * F: number of sparse features
  * D: embedding_dimension of sparse features
  * B: batch size
  * num_features: number of dense features
  
  Args:
      embedding_bag_collection (EmbeddingBagCollection): collection of embedding bags
          used to define `SparseArch`.
      dense_in_features (int): the dimensionality of the dense input features.
      dense_arch_layer_sizes (List[int]): the layer sizes for the `DenseArch`.
      over_arch_layer_sizes (List[int]): the layer sizes for the `OverArch`.
          The output dimension of the `InteractionArch` should not be manually
          specified here.
      dense_device (Optional[torch.device]): default compute device.
  
  Example::
  
      B = 2
      D = 8
  
      eb1_config = EmbeddingBagConfig(
          name="t1", embedding_dim=D, num_embeddings=100, feature_names=["f1"]
      )
      eb2_config = EmbeddingBagConfig(
          name="t2",
          embedding_dim=D,
          num_embeddings=100,
          feature_names=["f2"],
      )
  
      ebc = EmbeddingBagCollection(tables=[eb1_config, eb2_config])
      model = DLRM(
          embedding_bag_collection=ebc,
          dense_in_features=100,
          dense_arch_layer_sizes=[20, D],
          over_arch_layer_sizes=[5, 1],
      )
  
      features = torch.rand((B, 100))
  
      #     0       1
      # 0   [1,2] [4,5]
      # 1   [4,3] [2,9]
      # ^
      # feature
      sparse_features = KeyedJaggedTensor.from_offsets_sync(
          keys=["f1", "f2"],
          values=torch.tensor([1, 2, 4, 5, 4, 3, 2, 9]),
          offsets=torch.tensor([0, 2, 4, 6, 8]),
      )
  
      logits = model(
          dense_features=features,
          sparse_features=sparse_features,
      )
class_docstr_tok: ["Recsys","model","from","``","Deep","Learning","Recommendation","Model","for","Personalization","and","Recommendation","Systems","''","(","https",":","\/\/arxiv.org\/abs\/1906.00091",")",".","Processes","sparse","features","by","learning","pooled","embeddings","for","each","feature",".","Learns","the","relationship","between","dense","features","and","sparse","features","by","projecting","dense","features","into","the","same","embedding","space",".","Also",",","learns","the","pairwise","relationships","between","sparse","features",".","The","module","assumes","all","sparse","features","have","the","same","embedding","dimension","(","i.e",".","each","EmbeddingBagConfig","uses","the","same","embedding_dim",")",".","The","following","notation","is","used","throughout","the","documentation","for","the","models",":","*","F",":","number","of","sparse","features","*","D",":","embedding_dimension","of","sparse","features","*","B",":","batch","size","*","num_features",":","number","of","dense","features","Args",":","embedding_bag_collection","(","EmbeddingBagCollection",")",":","collection","of","embedding","bags","used","to","define","`","SparseArch","`",".","dense_in_features","(","int",")",":","the","dimensionality","of","the","dense","input","features",".","dense_arch_layer_sizes","(","List","[","int","]",")",":","the","layer","sizes","for","the","`","DenseArch","`",".","over_arch_layer_sizes","(","List","[","int","]",")",":","the","layer","sizes","for","the","`","OverArch","`",".","The","output","dimension","of","the","`","InteractionArch","`","should","not","be","manually","specified","here",".","dense_device","(","Optional","[","torch.device","]",")",":","default","compute","device",".","Example",":",":","B","=","2","D","=","8","eb1_config","=","EmbeddingBagConfig","(","name=","''","t1","''",",","embedding_dim=D",",","num_embeddings=100",",","feature_names=","[","``","f1","''","]",")","eb2_config","=","EmbeddingBagConfig","(","name=","''","t2","''",",","embedding_dim=D",",","num_embeddings=100",",","feature_names=","[","``","f2","''","]",",",")","ebc","=","EmbeddingBagCollection","(","tables=","[","eb1_config",",","eb2_config","]",")","model","=","DLRM","(","embedding_bag_collection=ebc",",","dense_in_features=100",",","dense_arch_layer_sizes=","[","20",",","D","]",",","over_arch_layer_sizes=","[","5",",","1","]",",",")","features","=","torch.rand","(","(","B",",","100",")",")","#","0","1","#","0","[","1,2","]","[","4,5","]","#","1","[","4,3","]","[","2,9","]","#","^","#","feature","sparse_features","=","KeyedJaggedTensor.from_offsets_sync","(","keys=","[","``","f1","''",",","``","f2","''","]",",","values=torch.tensor","(","[","1",",","2",",","4",",","5",",","4",",","3",",","2",",","9","]",")",",","offsets=torch.tensor","(","[","0",",","2",",","4",",","6",",","8","]",")",",",")","logits","=","model","(","dense_features=features",",","sparse_features=sparse_features",",",")"]
docstr: Args:
      dense_features (torch.Tensor): the dense features.
      sparse_features (KeyedJaggedTensor): the sparse features.
  
  Returns:
      torch.Tensor: logits.
docstr_tok: ["Args",":","dense_features","(","torch.Tensor",")",":","the","dense","features",".","sparse_features","(","KeyedJaggedTensor",")",":","the","sparse","features",".","Returns",":","torch.Tensor",":","logits","."]
code: def forward(
      self,
      dense_features: torch.Tensor,
      sparse_features: KeyedJaggedTensor,
  ) -> torch.Tensor:
      """
      Args:
          dense_features (torch.Tensor): the dense features.
          sparse_features (KeyedJaggedTensor): the sparse features.
  
      Returns:
          torch.Tensor: logits.
      """
      embedded_dense = self.dense_arch(dense_features)
      embedded_sparse = self.sparse_arch(sparse_features)
      concatenated_dense = self.inter_arch(
          dense_features=embedded_dense, sparse_features=embedded_sparse
      )
      logits = self.over_arch(concatenated_dense)
      return logits
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from torchrec.datasets.utils import Batch
  from torchrec.modules.crossnet import LowRankCrossNet
  from torchrec.modules.embedding_modules import EmbeddingBagCollection
  from torchrec.modules.mlp import MLP
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor, KeyedTensor
label_desc: Use image node_id 2 for calling the DLRM obj's underlying member method code with example usage: obj.forward(dense_features, sparse_features) and returns: logits