class_docstr: To create our :class:`~flash.core.data.data_module.DataModule` we first set the ``input_transform_cls``
  attribute.
  
  Next, we add a ``from_numpy`` method and a ``from_sklearn`` method. Finally, we define the ``num_features`` property
  for convenience.
docstr: Tries to get the ``num_features`` from each dataset in turn and returns the output.
docstr_tok: ["Tries","to","get","the","``","num_features","``","from","each","dataset","in","turn","and","returns","the","output","."]
code: def num_features(self) -> Optional[int]:
      """Tries to get the ``num_features`` from each dataset in turn and returns the output."""
      n_fts_train = getattr(self.train_dataset, "num_features", None)
      n_fts_val = getattr(self.val_dataset, "num_features", None)
      n_fts_test = getattr(self.test_dataset, "num_features", None)
      return n_fts_train or n_fts_val or n_fts_test
  
imports: from typing import Any, Callable, Collection, Dict, List, Optional, Sequence, Tuple, Type
  import numpy
  import torch
  from flash.core.data.base_viz import BaseVisualization
  from flash.core.data.callback import BaseDataFetcher
  from flash.core.data.data_module import DataModule
  from flash.core.data.io.classification_input import ClassificationInputMixin
  from flash.core.data.io.input import DataKeys, Input
  from flash.core.data.io.input_transform import InputTransform
  from flash.core.data.utilities.classification import TargetFormatter
  from flash.core.data.utilities.samples import to_samples
  from flash.core.utilities.imports import _SKLEARN_AVAILABLE
  from flash.core.utilities.stages import RunningStage
  from flash.core.utilities.types import INPUT_TRANSFORM_TYPE
label_desc: Use image node_id 3 for calling the TemplateData obj's underlying member method code with example usage: obj.num_features() and returns: unknown