code: def _init_input_modules(g, ntype, textset, hidden_dims):
      # We initialize the linear projections of each input feature ``x`` as
      # follows:
      # * If ``x`` is a scalar integral feature, we assume that ``x`` is a categorical
      #   feature, and assume the range of ``x`` is 0..max(x).
      # * If ``x`` is a float one-dimensional feature, we assume that ``x`` is a
      #   numeric vector.
      # * If ``x`` is a field of a textset, we process it as bag of words.
      module_dict = nn.ModuleDict()
  
      for column, data in g.nodes[ntype].data.items():
          if column == dgl.NID:
              continue
          if data.dtype == torch.float32:
              assert data.ndim == 2
              m = nn.Linear(data.shape[1], hidden_dims)
              nn.init.xavier_uniform_(m.weight)
              nn.init.constant_(m.bias, 0)
              module_dict[column] = m
          elif data.dtype == torch.int64:
              assert data.ndim == 1
              m = nn.Embedding(
                  data.max() + 2, hidden_dims, padding_idx=-1
              )
              nn.init.xavier_uniform_(m.weight)
              module_dict[column] = m
  
      if textset is not None:
          for column, field in textset.fields.items():
              if field.vocab.vectors:
                  module_dict[column] = BagOfWordsPretrained(
                      field, hidden_dims
                  )
              else:
                  module_dict[column] = BagOfWords(field, hidden_dims)
  
      return module_dict
  
imports: import argparse
  import pickle
  import time
  import dgl
  import dgl.function
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import DataLoader, IterableDataset
  from ..None import utils
label_desc: Use image node_id 1 for calling a global function with example usage: _init_input_modules(g, ntype, textset, hidden_dims) and returns: module_dict