class_docstr: Selectable global pooling layer with dynamic input kernel size
      
class_docstr_tok: ["Selectable","global","pooling","layer","with","dynamic","input","kernel","size"]
code: def __init__(self, output_size=1, pool_type="avg"):
      super(AdaptiveAvgMaxPool2d, self).__init__()
      self.output_size = output_size
      self.pool_type = pool_type
      if pool_type in ("avgmaxc", "avgmax"):
          self.pool = nn.ModuleList(
              [
                  nn.AdaptiveAvgPool2d(output_size),
                  nn.AdaptiveMaxPool2d(output_size),
              ]
          )
      elif pool_type == "max":
          self.pool = nn.AdaptiveMaxPool2d(output_size)
      else:
          if pool_type != "avg":
              print(
                  "Invalid pool type %s specified. Defaulting to average pooling."
                  % pool_type
              )
          self.pool = nn.AdaptiveAvgPool2d(output_size)
  
file_path: pywick/pywick/models/classification/dpn/adaptive_avgmax_pool.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new AdaptiveAvgMaxPool2d object from inherited base classes: torch.nn with example: obj = AdaptiveAvgMaxPool2d(output_size, pool_type)