class_docstr: Vector Cross Network can be refered as
  `DCN-V1 <https://arxiv.org/pdf/1708.05123.pdf>`_.
  
  It is also a specialized low rank cross net, where rank=1. In this version, on each
  layer, instead of keeping two kernels W and V, we only keep one vector kernel W
  (Nx1). We use the dot operation to compute the "crossing" effect of the features,
  thus saving two matrix multiplications to further reduce computational cost and cut
  the number of learnable parameters.
  
  On each layer l, the tensor is transformed into
  
  .. math::    x_{l+1} = x_0 * (W_l . x_l + b_l) + x_l
  
  where :math:`W_l` is either a vector, :math:`*` means element-wise multiplication;
  :math:`.` means dot operations.
  
  Args:
      in_features (int): the dimension of the input.
      num_layers (int): the number of layers in the module.
  
  Example::
  
      batch_size = 3
      num_layers = 2
      in_features = 10
      input = torch.randn(batch_size, in_features)
      dcn = VectorCrossNet(num_layers=num_layers)
      output = dcn(input)
class_docstr_tok: ["Vector","Cross","Network","can","be","refered","as","`","DCN-V1","<","https",":","\/\/arxiv.org\/pdf\/1708.05123.pdf",">","`","_",".","It","is","also","a","specialized","low","rank","cross","net",",","where","rank=1",".","In","this","version",",","on","each","layer",",","instead","of","keeping","two","kernels","W","and","V",",","we","only","keep","one","vector","kernel","W","(","Nx1",")",".","We","use","the","dot","operation","to","compute","the","``","crossing","''","effect","of","the","features",",","thus","saving","two","matrix","multiplications","to","further","reduce","computational","cost","and","cut","the","number","of","learnable","parameters",".","On","each","layer","l",",","the","tensor","is","transformed","into","..","math",":",":","x_","{","l+1","}","=","x_0","*","(","W_l",".","x_l","+","b_l",")","+","x_l","where",":","math",":","`","W_l","`","is","either","a","vector",",",":","math",":","`","*","`","means","element-wise","multiplication",";",":","math",":","`",".","`","means","dot","operations",".","Args",":","in_features","(","int",")",":","the","dimension","of","the","input",".","num_layers","(","int",")",":","the","number","of","layers","in","the","module",".","Example",":",":","batch_size","=","3","num_layers","=","2","in_features","=","10","input","=","torch.randn","(","batch_size",",","in_features",")","dcn","=","VectorCrossNet","(","num_layers=num_layers",")","output","=","dcn","(","input",")"]
code: def __init__(
      self,
      in_features: int,
      num_layers: int,
  ) -> None:
      super().__init__()
      self._num_layers = num_layers
      self.kernels: torch.nn.Module = torch.nn.ParameterList(
          [
              torch.nn.Parameter(
                  torch.nn.init.xavier_normal_(
                      torch.empty(in_features, 1)
                  )
              )
              for i in range(self._num_layers)
          ]
      )
      self.bias: torch.nn.Module = torch.nn.ParameterList(
          [
              torch.nn.Parameter(
                  torch.nn.init.zeros_(torch.empty(in_features, 1))
              )
              for i in range(self._num_layers)
          ]
      )
  
file_path: torchrec/torchrec/modules/crossnet.py
imports: from typing import Callable, Optional, Union
  import torch
label_desc: Use image node_id 1 to create a new VectorCrossNet object from inherited base classes: torch.nn with example: obj = VectorCrossNet(in_features, num_layers)