code: def test_estimator_without_batch(self):
      def model_fn(features, labels, mode):
          assert features.shape.ndims == 1
          if labels is not None:
              assert labels.shape.ndims == 0
  
          features = tf.expand_dims(features, axis=0)
  
          h1 = tf.layers.dense(features, 64, activation=tf.nn.relu)
          h2 = tf.layers.dense(h1, 64, activation=tf.nn.relu)
          logits = tf.layers.dense(h2, 10)
  
          if (
              mode == tf.estimator.ModeKeys.EVAL
              or mode == tf.estimator.ModeKeys.TRAIN
          ):
              labels = tf.expand_dims(labels, axis=0)
              loss = tf.reduce_mean(
                  tf.losses.sparse_softmax_cross_entropy(
                      logits=logits, labels=labels
                  )
              )
              train_op = ZooOptimizer(
                  tf.train.AdamOptimizer()
              ).minimize(loss)
              return tf.estimator.EstimatorSpec(
                  mode, train_op=train_op, predictions=logits, loss=loss
              )
          else:
              return tf.estimator.EstimatorSpec(
                  mode, predictions=logits
              )
  
      def input_fn(mode):
          np.random.seed(20)
          x = np.random.rand(20, 10)
          y = np.random.randint(0, 10, (20))
  
          rdd_x = self.sc.parallelize(x)
          rdd_y = self.sc.parallelize(y)
  
          rdd = rdd_x.zip(rdd_y)
          if (
              mode == tf.estimator.ModeKeys.TRAIN
              or mode == tf.estimator.ModeKeys.EVAL
          ):
              dataset = TFDataset.from_rdd(
                  rdd,
                  features=(tf.float32, [10]),
                  labels=(tf.int32, []),
              )
          else:
              dataset = TFDataset.from_rdd(
                  rdd_x, features=(tf.float32, [10])
              )
          return dataset
  
      estimator = TFEstimator.from_model_fn(model_fn)
  
      self.intercept(
          lambda: estimator.train(input_fn, steps=1),
          "The batch_size of TFDataset must be specified when used for training.",
      )
  
      estimator.evaluate(input_fn, ["acc"])
      estimator.predict(input_fn).collect()
  
imports: import pytest
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  import tensorflow
  from zoo.feature.common import ChainedPreprocessing, FeatureSet
  from zoo.feature.image import *
  from zoo.tfpark import TFDataset, TFEstimator
  from zoo.tfpark import ZooOptimizer
label_desc: Use image node_id 8 for calling the TestTFParkEstimator obj's underlying member method code with example usage: obj.test_estimator_without_batch() and returns: dataset, tf, tf