class_docstr: A class to generate CNN.
  Attributes:
        n_dim: `len(self.input_shape) - 1`
        conv: A class that represents `(n_dim-1)` dimensional convolution.
        dropout: A class that represents `(n_dim-1)` dimensional dropout.
        global_avg_pooling: A class that represents `(n_dim-1)` dimensional Global Average Pooling.
        pooling: A class that represents `(n_dim-1)` dimensional pooling.
        batch_norm: A class that represents `(n_dim-1)` dimensional batch normalization.
class_docstr_tok: ["A","class","to","generate","CNN",".","Attributes",":","n_dim",":","`","len","(","self.input_shape",")","-","1","`","conv",":","A","class","that","represents","`","(","n_dim-1",")","`","dimensional","convolution",".","dropout",":","A","class","that","represents","`","(","n_dim-1",")","`","dimensional","dropout",".","global_avg_pooling",":","A","class","that","represents","`","(","n_dim-1",")","`","dimensional","Global","Average","Pooling",".","pooling",":","A","class","that","represents","`","(","n_dim-1",")","`","dimensional","pooling",".","batch_norm",":","A","class","that","represents","`","(","n_dim-1",")","`","dimensional","batch","normalization","."]
code: def __init__(self, n_output_node, input_shape):
      super(CnnGenerator, self).__init__(n_output_node, input_shape)
      self.n_dim = len(self.input_shape) - 1
      if len(self.input_shape) > 4:
          raise ValueError("The input dimension is too high.")
      if len(self.input_shape) < 2:
          raise ValueError("The input dimension is too low.")
      self.conv = get_conv_class(self.n_dim)
      self.dropout = get_dropout_class(self.n_dim)
      self.global_avg_pooling = get_global_avg_pooling_class(self.n_dim)
      self.pooling = get_pooling_class(self.n_dim)
      self.batch_norm = get_batch_norm_class(self.n_dim)
  
file_path: nni/nni/algorithms/hpo/networkmorphism_tuner/nn.py
imports: from abc import abstractmethod
  from .graph import Graph
  from .layers import StubDense, StubDropout1d, StubReLU, get_batch_norm_class, get_conv_class, get_dropout_class, get_global_avg_pooling_class, get_pooling_class
  from .utils import Constant
label_desc: Use image node_id 1 to create a new CnnGenerator object from inherited base classes: NetworkGenerator with example: obj = CnnGenerator(n_output_node, input_shape)