class_docstr: Shallow models for knowledge representation learning.
      
docstr: Initialize features and linear layers when use_feature is True
          
code: def _init_features(self, trigraph):
      """Initialize features and linear layers when use_feature is True"""
      self._use_feat = self._args.use_feature
      self._ent_feat = None
      self._rel_feat = None
  
      if self._use_feat:
          is_empty = lambda x: x is None or len(x) == 0
          self._ent_feat = trigraph.ent_feat
          self._rel_feat = trigraph.rel_feat
          ent_dim = self._args.ent_dim
          rel_dim = self._args.rel_dim
  
          if is_empty(self._ent_feat) and is_empty(self._rel_feat):
              raise ValueError(
                  "There is no feature given in the dataset."
              )
  
          if self._ent_feat is not None:
              ent_feat_dim = self._ent_feat.shape[-1]
              self.trans_ent = Transform(
                  ent_feat_dim + ent_dim, ent_dim
              )
              print(
                  "Entity feature dimension is    : {}".format(
                      ent_feat_dim
                  )
              )
          else:
              warnings.warn(
                  "No features given! Ignore use_feature for entities."
              )
  
          if self._rel_feat is not None:
              rel_feat_dim = self._rel_feat.shape[-1]
              self.trans_rel = Transform(
                  rel_feat_dim + rel_dim, rel_dim
              )
              print(
                  "Relation feature dimension is  : {}".format(
                      rel_feat_dim
                  )
              )
          else:
              warnings.warn(
                  "No features given! Ignore use_feature for relations."
              )
  
imports: import os
  import json
  import math
  import warnings
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from pgl.utils.shared_embedding import SharedEmbedding
  from models.score_funcs import TransEScore, RotatEScore, DistMultScore, ComplExScore, QuatEScore, OTEScore
  from models.init_func import InitFunction
  from utils import uniform, timer_wrapper
label_desc: Use image node_id 19 for calling the KGEModel obj's underlying member method code with example usage: obj._init_features(trigraph) without return types