code: def convert_to_torch(X_enc: pd.DataFrame, y_enc: Optional[pd.DataFrame]):  # type: ignore
      """
          Converts X, y to torch tensors compatible with ndata/edata of DGL graph
      _________________________________________________________________________
      :param X_enc: DataFrame Matrix of Values for Model Matrix
      :param y_enc: DataFrame Matrix of Values for Target
      :return: Dictionary of torch encoded arrays
      """
      _, _, torch = lazy_torch_import_has_dependency()  # noqa: F811
  
      if not y_enc.empty:  # type: ignore
          data = {
              config.FEATURE: torch.tensor(X_enc.values),
              config.TARGET: torch.tensor(y_enc.values),  # type: ignore
          }
      else:
          data = {config.FEATURE: torch.tensor(X_enc.values)}
      return data
  
imports: from collections import Counter
  from typing import Dict, Optional, TYPE_CHECKING, Tuple
  import numpy
  import pandas
  from .None import constants
  from .feature_utils import FeatureEngine, FeatureMixin, resolve_feature_engine, XSymbolic, YSymbolic, resolve_X, resolve_y
  from .util import setup_logger
label_desc: Use image node_id 3 for calling a global function with example usage: convert_to_torch(X_enc, y_enc) and returns: data