class_docstr: X3D head.
  This layer performs a fully-connected projection during training, when the
  input size is 1x1x1. It performs a convolutional projection during testing
  when the input size is larger than 1x1x1. If the inputs are from multiple
  different pathways, the inputs will be concatenated after pooling.
class_docstr_tok: ["X3D","head",".","This","layer","performs","a","fully-connected","projection","during","training",",","when","the","input","size","is","1x1x1",".","It","performs","a","convolutional","projection","during","testing","when","the","input","size","is","larger","than","1x1x1",".","If","the","inputs","are","from","multiple","different","pathways",",","the","inputs","will","be","concatenated","after","pooling","."]
docstr: The `__init__` method of any subclass should also contain these
      arguments.
  X3DHead takes a 5-dim feature tensor (BxCxTxHxW) as input.
  
  Args:
      dim_in (float): the channel dimension C of the input.
      num_classes (int): the channel dimensions of the output.
      pool_size (float): a single entry list of kernel size for
          spatiotemporal pooling for the TxHxW dimensions.
      dropout_rate (float): dropout rate. If equal to 0.0, perform no
          dropout.
      act_func (string): activation function to use. 'softmax': applies
          softmax on the output. 'sigmoid': applies sigmoid on the output.
      inplace_relu (bool): if True, calculate the relu on the original
          input without allocating new memory.
      eps (float): epsilon for batch norm.
      bn_mmt (float): momentum for batch norm. Noted that BN momentum in
          PyTorch = 1 - BN momentum in Caffe2.
      norm_module (nn.Module): nn.Module for the normalization layer. The
          default is nn.BatchNorm3d.
      bn_lin5_on (bool): if True, perform normalization on the features
          before the classifier.
docstr_tok: ["The","`","__init__","`","method","of","any","subclass","should","also","contain","these","arguments",".","X3DHead","takes","a","5-dim","feature","tensor","(","BxCxTxHxW",")","as","input",".","Args",":","dim_in","(","float",")",":","the","channel","dimension","C","of","the","input",".","num_classes","(","int",")",":","the","channel","dimensions","of","the","output",".","pool_size","(","float",")",":","a","single","entry","list","of","kernel","size","for","spatiotemporal","pooling","for","the","TxHxW","dimensions",".","dropout_rate","(","float",")",":","dropout","rate",".","If","equal","to","0.0",",","perform","no","dropout",".","act_func","(","string",")",":","activation","function","to","use",".","'softmax","'",":","applies","softmax","on","the","output",".","'sigmoid","'",":","applies","sigmoid","on","the","output",".","inplace_relu","(","bool",")",":","if","True",",","calculate","the","relu","on","the","original","input","without","allocating","new","memory",".","eps","(","float",")",":","epsilon","for","batch","norm",".","bn_mmt","(","float",")",":","momentum","for","batch","norm",".","Noted","that","BN","momentum","in","PyTorch","=","1","-","BN","momentum","in","Caffe2",".","norm_module","(","nn.Module",")",":","nn.Module","for","the","normalization","layer",".","The","default","is","nn.BatchNorm3d",".","bn_lin5_on","(","bool",")",":","if","True",",","perform","normalization","on","the","features","before","the","classifier","."]
code: def __init__(
      self,
      dim_in,
      dim_inner,
      dim_out,
      num_classes,
      pool_size,
      dropout_rate=0.0,
      act_func="softmax",
      inplace_relu=True,
      eps=1e-5,
      bn_mmt=0.1,
      norm_module=nn.BatchNorm3d,
      bn_lin5_on=False,
  ):
      """
      The `__init__` method of any subclass should also contain these
          arguments.
      X3DHead takes a 5-dim feature tensor (BxCxTxHxW) as input.
  
      Args:
          dim_in (float): the channel dimension C of the input.
          num_classes (int): the channel dimensions of the output.
          pool_size (float): a single entry list of kernel size for
              spatiotemporal pooling for the TxHxW dimensions.
          dropout_rate (float): dropout rate. If equal to 0.0, perform no
              dropout.
          act_func (string): activation function to use. 'softmax': applies
              softmax on the output. 'sigmoid': applies sigmoid on the output.
          inplace_relu (bool): if True, calculate the relu on the original
              input without allocating new memory.
          eps (float): epsilon for batch norm.
          bn_mmt (float): momentum for batch norm. Noted that BN momentum in
              PyTorch = 1 - BN momentum in Caffe2.
          norm_module (nn.Module): nn.Module for the normalization layer. The
              default is nn.BatchNorm3d.
          bn_lin5_on (bool): if True, perform normalization on the features
              before the classifier.
      """
      super(X3DHead, self).__init__()
      self.pool_size = pool_size
      self.dropout_rate = dropout_rate
      self.num_classes = num_classes
      self.act_func = act_func
      self.eps = eps
      self.bn_mmt = bn_mmt
      self.inplace_relu = inplace_relu
      self.bn_lin5_on = bn_lin5_on
      self._construct_head(dim_in, dim_inner, dim_out, norm_module)
  
imports: from functools import partial
  import torch
  import torch.nn
  from detectron2.layers import ROIAlign
  import slowfast.utils.logging
  from slowfast.models.attention import MultiScaleBlock
  from slowfast.models.batchnorm_helper import NaiveSyncBatchNorm1d
  from slowfast.models.nonlocal_helper import Nonlocal
label_desc: Use image node_id 1 to create a new X3DHead object from inherited base classes: nn with example: obj = X3DHead(dim_in, dim_inner, dim_out, num_classes, pool_size, dropout_rate, act_func, inplace_relu, eps, bn_mmt, norm_module, bn_lin5_on)