code: def gen_tensorflow_dataset(
      tensors,
      output_shapes: Tuple[int, ...] = None,
      output_types: Tuple[np.dtype, ...] = None,
      fetch_kwargs=None,
  ):
      """
      convert mars data type to tf.data.Dataset. Note this is based tensorflow 2.0
      For example
      -----------
      >>> # convert a tensor to tf.data.Dataset.
      >>> data = mt.tensor([[1, 2], [3, 4]])
      >>> dataset = gen_tensorflow_dataset(data)
      >>> list(dataset.as_numpy_iterator())
      [array([1, 2]), array([3, 4])]
      >>> dataset.element_spec
      TensorSpec(shape=(2,), dtype=tf.int64, name=None)
  
      >>> # convert a tuple of tensors to tf.data.Dataset.
      >>> data1 = mt.tensor([1, 2]); data2 = mt.tensor([3, 4]); data3 = mt.tensor([5, 6])
      >>> dataset = gen_tensorflow_dataset((data1, data2, data3))
      >>> list(dataset.as_numpy_iterator())
      [(1, 3, 5), (2, 4, 6)]
  
      Parameters
      ----------
      tensors: Mars data type or a tuple consisting of Mars data type
          the data that convert to tf.data.dataset
      output_shapes:
          A (nested) structure of `tf.TensorShape` objects corresponding to
          each component of an element yielded from mars object.
      output_types:
          A (nested) structure of `tf.DType` objects corresponding to each
          component of an element yielded from mars object.
      fetch_kwargs:
          the parameters of mars object executes fetch() operation.
      Returns
      -------
          tf.data.Dataset
      """
      mars_dataset = MarsDataset(
          tensors,
          output_shapes=output_shapes,
          output_types=output_types,
          fetch_kwargs=fetch_kwargs,
      )
  
      return mars_dataset.to_tf()
  
file_path: mars/mars/learn/contrib/tensorflow/dataset.py
imports: import copy
  from typing import List, Tuple
  import pandas
  import numpy
  from ....None import execute
  from ....core.context import get_context
  from ....tensor.core import TENSOR_TYPE
  from ....dataframe.core import DATAFRAME_TYPE, SERIES_TYPE
  from ....utils import require_not_none, lazy_import
label_desc: Use image node_id 1 for calling a global function with example usage: gen_tensorflow_dataset(tensors, output_shapes, output_types, fetch_kwargs) and returns: mars_dataset