docstr: Creates a copy of the datamodule with the train and validation datasets removed. This is useful for inference
  only scenarios where we don't want to save the train and validation datasets.
  
  Returns:
      TabularDatamodule: A copy of the datamodule with the train and validation datasets removed.
docstr_tok: ["Creates","a","copy","of","the","datamodule","with","the","train","and","validation","datasets","removed",".","This","is","useful","for","inference","only","scenarios","where","we","do","n't","want","to","save","the","train","and","validation","datasets",".","Returns",":","TabularDatamodule",":","A","copy","of","the","datamodule","with","the","train","and","validation","datasets","removed","."]
code: def inference_only_copy(self):
      """Creates a copy of the datamodule with the train and validation datasets removed. This is useful for inference
      only scenarios where we don't want to save the train and validation datasets.
  
      Returns:
          TabularDatamodule: A copy of the datamodule with the train and validation datasets removed.
      """
      if not self._fitted:
          raise RuntimeError(
              "Can create an inference only copy only after model is fitted"
          )
      dm_inference = copy.copy(self)
      dm_inference.train_dataset = None
      dm_inference.validation_dataset = None
      dm_inference.cache_mode = self.CACHE_MODES.INFERENCE
      return dm_inference
  
imports: import re
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  import joblib
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from omegaconf import DictConfig
  from pandas import DataFrame, DatetimeTZDtype, to_datetime
  from pandas.tseries import offsets
  from pandas.tseries.frequencies import to_offset
  from sklearn.base import TransformerMixin, copy
  from sklearn.preprocessing import FunctionTransformer, LabelEncoder, PowerTransformer, QuantileTransformer, StandardScaler
  from torch.utils.data import DataLoader, Dataset
  from pytorch_tabular.config import InferredConfig
  from pytorch_tabular.utils import get_logger
  from .categorical_encoders import OrdinalEncoder
label_desc: Use image node_id 26 for calling the TabularDatamodule obj's underlying member method code with example usage: obj.inference_only_copy() and returns: dm_inference