code: def test_spark_xshards(self):
      from zoo import init_nncontext
      from zoo.orca.data import SparkXShards
  
      estimator = get_estimator(workers_per_node=1)
      sc = init_nncontext()
      x_rdd = sc.parallelize(
          np.random.rand(4000, 1, 50).astype(np.float32)
      )
      # torch 1.7.1+ requires target size same as output size, which is (batch, 1)
      y_rdd = sc.parallelize(
          np.random.randint(0, 2, size=(4000, 1, 1)).astype(np.float32)
      )
      rdd = x_rdd.zip(y_rdd).map(lambda x_y: {"x": x_y[0], "y": x_y[1]})
      train_rdd, val_rdd = rdd.randomSplit([0.9, 0.1])
      train_xshards = SparkXShards(train_rdd)
      val_xshards = SparkXShards(val_rdd)
      train_stats = estimator.fit(
          train_xshards, batch_size=256, epochs=2
      )
      print(train_stats)
      val_stats = estimator.evaluate(val_xshards, batch_size=128)
      print(val_stats)
      estimator.shutdown()
  
imports: import os
  from unittest import TestCase
  import numpy
  import pytest
  import torch
  import torch.nn
  from zoo.orca import OrcaContext
  from zoo.orca.data.pandas import read_csv
  from zoo.orca.learn.metrics import Accuracy
  from zoo import init_nncontext
  from zoo.orca.learn.pytorch import Estimator
  from zoo.orca.data import SparkXShards
  from zoo.orca.data.image.utils import chunks
label_desc: Use image node_id 2 for calling the TestPyTorchEstimator obj's underlying member method code with example usage: obj.test_spark_xshards() without return types