class_docstr: A convolutional neural network for text classification which implemented by pytorch.
  
  We use different versions of this network to pretrain models for
  text classification.
code: def __init__(
      self,
      init_embedding=None,
      embedding_shape=None,
      hidden_size=100,
      dropout=0.2,
      num_labels=2,
      model_path=None,
  ):
      super().__init__()
      if init_embedding is not None:
          self.emb_layer = nn.Embedding.from_pretrained(
              torch.from_numpy(init_embedding)
          )
      elif embedding_shape is not None:
          self.emb_layer = nn.Embedding(
              embedding_shape[0], embedding_shape[1]
          )
      else:
          raise ValueError(
              "Cant init embedding layer cuz empty embedding "
              "and empty embedding shape."
          )
      self.drop = nn.Dropout(dropout)
  
      self.encoder = CNNTextLayer(
          self.emb_layer.embedding_dim,
          widths=[3, 4, 5],
          filters=hidden_size,
      )
  
      d_out = 3 * hidden_size
      self.linear = nn.Linear(d_out, num_labels)
      self.out = nn.Softmax(dim=-1)
  
      if model_path is not None:
          self.load_from_disk(model_path)
  
      self.to(device)
  
file_path: textflint/textflint/input/model/test_model/textcnn_torch_model.py
imports: import torch
  from torch import nn
  from torch.nn import functional
  from .glove_embedding import GloveEmbedding
  from textflint.common.utils.load import load_cached_state_dict
  from textflint.common import device
label_desc: Use image node_id 1 to create a new TextCNNTorchModel object from inherited base classes: nn with example: obj = TextCNNTorchModel(init_embedding, embedding_shape, hidden_size, dropout, num_labels, model_path)