class_docstr: Learns default values to fill invalid entries within input tensors. The
  invalid entries are represented by a mask which is passed into forward alongside
  the input tensor. Note the default value is only used if all entries in the batch row are
  invalid rather than just a portion of invalid entries within each batch row.
class_docstr_tok: ["Learns","default","values","to","fill","invalid","entries","within","input","tensors",".","The","invalid","entries","are","represented","by","a","mask","which","is","passed","into","forward","alongside","the","input","tensor",".","Note","the","default","value","is","only","used","if","all","entries","in","the","batch","row","are","invalid","rather","than","just","a","portion","of","invalid","entries","within","each","batch","row","."]
docstr: Args:
      feature_dim (int): the size of the default value parameter, this must match the
          input tensor size.
      init_method (str): the initial default value parameter. Options:
          'guassian'
          'zeros'
      freeze (bool): If True, the learned default parameter weights are frozen.
docstr_tok: ["Args",":","feature_dim","(","int",")",":","the","size","of","the","default","value","parameter",",","this","must","match","the","input","tensor","size",".","init_method","(","str",")",":","the","initial","default","value","parameter",".","Options",":","'guassian'","'zeros'","freeze","(","bool",")",":","If","True",",","the","learned","default","parameter","weights","are","frozen","."]
code: def __init__(
      self,
      feature_dim: int,
      init_method: str = "gaussian",
      freeze: bool = False,
  ):
      """
      Args:
          feature_dim (int): the size of the default value parameter, this must match the
              input tensor size.
          init_method (str): the initial default value parameter. Options:
              'guassian'
              'zeros'
          freeze (bool): If True, the learned default parameter weights are frozen.
      """
      super().__init__()
      if init_method == "zeros":
          self._learned_defaults = nn.Parameter(
              torch.zeros(feature_dim), requires_grad=(not freeze)
          )
      elif init_method == "gaussian":
          self._learned_defaults = nn.Parameter(
              torch.Tensor(feature_dim), requires_grad=(not freeze)
          )
          nn.init.normal_(self._learned_defaults)
      else:
          raise NotImplementedError(
              f"{init_method} not available. Options are: 'zeros' or 'gaussian'"
          )
  
imports: from typing import List, Optional, Tuple
  import torch
  from pytorchvideo.layers.utils import set_attributes
  from torch import nn
  from torch.nn.utils.rnn import pack_padded_sequence
label_desc: Use image node_id 1 to create a new LearnMaskedDefault object from inherited base classes: nn with example: obj = LearnMaskedDefault(feature_dim, init_method, freeze)