code: def dataset_generation():
      data_dir = tf.keras.utils.get_file(
          "flower_photos", origin=dataset_url, untar=True
      )
      data_dir = pathlib.Path(data_dir)
  
      train_ds = tf.keras.utils.image_dataset_from_directory(
          data_dir,
          validation_split=0.2,
          subset="training",
          seed=123,
          image_size=(img_height, img_width),
          batch_size=batch_size,
      )
  
      val_ds = tf.keras.utils.image_dataset_from_directory(
          data_dir,
          validation_split=0.2,
          subset="validation",
          seed=123,
          image_size=(img_height, img_width),
          batch_size=batch_size,
      )
  
      class_names = train_ds.class_names
  
      AUTOTUNE = tf.data.AUTOTUNE
  
      train_ds = (
          train_ds.cache().shuffle(100).prefetch(buffer_size=AUTOTUNE)
      )
  
      num_classes = len(class_names)
  
      return num_classes, train_ds, val_ds
  
file_path: BigDL/python/nano/test/tf/train/test_fit_graph.py
imports: import os
  import pathlib
  import tensorflow
  from tensorflow.keras import layers
  from bigdl.nano.tf.keras import Sequential
  from distutils.version import LooseVersion
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: dataset_generation() and returns: num_classes,  train_ds,  val_ds