class_docstr: This head defines a 3d average pooling layer (:class:`torch.nn.AvgPool3d` or
  :class:`torch.nn.AdaptiveAvgPool3d` if pool_size is None) followed by a fully
  convolutional linear layer. 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.
class_docstr_tok: ["This","head","defines","a","3d","average","pooling","layer","(",":","class",":","`","torch.nn.AvgPool3d","`","or",":","class",":","`","torch.nn.AdaptiveAvgPool3d","`","if","pool_size","is","None",")","followed","by","a","fully","convolutional","linear","layer",".","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","."]
docstr: Instantiates a FullyConvolutionalLinearHead from a configuration.
  
  Args:
      config: A configuration for a FullyConvolutionalLinearHead.
          See :func:`__init__` for parameters expected in the config.
  
  Returns:
      A FullyConvolutionalLinearHead instance.
docstr_tok: ["Instantiates","a","FullyConvolutionalLinearHead","from","a","configuration",".","Args",":","config",":","A","configuration","for","a","FullyConvolutionalLinearHead",".","See",":","func",":","`","__init__","`","for","parameters","expected","in","the","config",".","Returns",":","A","FullyConvolutionalLinearHead","instance","."]
code: def from_config(
      cls, config: Dict[str, Any]
  ) -> "FullyConvolutionalLinearHead":
      """Instantiates a FullyConvolutionalLinearHead from a configuration.
  
      Args:
          config: A configuration for a FullyConvolutionalLinearHead.
              See :func:`__init__` for parameters expected in the config.
  
      Returns:
          A FullyConvolutionalLinearHead instance.
      """
      required_args = ["in_plane", "num_classes"]
      for arg in required_args:
          assert arg in config, "argument %s is required" % arg
  
      config.update(
          {"activation_func": config.get("activation_func", "softmax")}
      )
      config.update({"use_dropout": config.get("use_dropout", False)})
  
      pool_size = config.get("pool_size", None)
      if pool_size is not None:
          assert isinstance(pool_size, Sequence) and len(pool_size) == 3
          for pool_size_dim in pool_size:
              assert is_pos_int(pool_size_dim)
  
      assert is_pos_int(config["in_plane"])
      assert is_pos_int(config["num_classes"])
  
      num_classes = config.get("num_classes", None)
      in_plane = config["in_plane"]
      return cls(
          config["unique_id"],
          num_classes,
          in_plane,
          pool_size,
          config["activation_func"],
          config["use_dropout"],
          config.get("dropout_ratio", 0.5),
      )
  
file_path: ClassyVision/classy_vision/heads/fully_convolutional_linear_head.py
imports: from collections.abc import Sequence
  from typing import Any, Dict, List, Optional
  import torch.nn
  from classy_vision.generic.util import is_pos_int
  from classy_vision.heads import ClassyHead, register_head
label_desc: Use image node_id 2 for calling the FullyConvolutionalLinearHead obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls