class_docstr: Embed sequences for MemNN model.
  
  Applies Position Encoding if enabled and currently applies BOW sum.
class_docstr_tok: ["Embed","sequences","for","MemNN","model",".","Applies","Position","Encoding","if","enabled","and","currently","applies","BOW","sum","."]
docstr: Initialize custom Embedding layer.
  
  :param position_encoding:
      apply positional encoding transformation on input sequences
  
  :param reduction:
      reduction strategy to sequences, default 'mean'
docstr_tok: ["Initialize","custom","Embedding","layer",".",":","param","position_encoding",":","apply","positional","encoding","transformation","on","input","sequences",":","param","reduction",":","reduction","strategy","to","sequences",",","default","'mean","'"]
code: def __init__(
      self, *args, position_encoding=False, reduction="mean", **kwargs
  ):
      """
      Initialize custom Embedding layer.
  
      :param position_encoding:
          apply positional encoding transformation on input sequences
  
      :param reduction:
          reduction strategy to sequences, default 'mean'
      """
      self.position_encoding = position_encoding
      self.reduction = reduction
      super().__init__(*args, **kwargs)
  
file_path: ParlAI/parlai/agents/memnn/modules.py
imports: import torch
  import torch.nn
  from parlai.utils.torch import neginf
  from functools import lru_cache
label_desc: Use image node_id 1 to create a new Embed object from inherited base classes: nn with example: obj = Embed()