code: def __init__(self, cfg):
      super(PCNN, self).__init__()
  
      self.use_pcnn = cfg.use_pcnn
      if cfg.dim_strategy == "cat":
          cfg.in_channels = cfg.word_dim + 2 * cfg.pos_dim
      else:
          cfg.in_channels = cfg.word_dim
  
      self.embedding = Embedding(cfg)
      self.cnn = CNN(cfg)
      self.fc1 = nn.Linear(
          len(cfg.kernel_sizes) * cfg.out_channels, cfg.intermediate
      )
      self.fc2 = nn.Linear(cfg.intermediate, cfg.num_relations)
      self.dropout = nn.Dropout(cfg.dropout)
  
      if self.use_pcnn:
          self.fc_pcnn = nn.Linear(
              3 * len(cfg.kernel_sizes) * cfg.out_channels,
              len(cfg.kernel_sizes) * cfg.out_channels,
          )
          self.pcnn_mask_embedding = nn.Embedding(4, 3)
          masks = torch.tensor(
              [[0, 0, 0], [100, 0, 0], [0, 100, 0], [0, 0, 100]]
          )
          self.pcnn_mask_embedding.weight.data.copy_(masks)
          self.pcnn_mask_embedding.weight.requires_grad = False
  
file_path: DeepKE/src/deepke/relation_extraction/standard/models/PCNN.py
imports: import os
  import sys
  import torch
  import torch.nn
  import torch.nn.functional
  from .None import BasicModule
  from module import Embedding, CNN
  from utils import seq_len_to_mask
label_desc: Use image node_id 1 to create a new PCNN object from inherited base classes: BasicModule with example: obj = PCNN(cfg)