getTrainData() {
    const xs = tf.tensor4d(
        this.trainImages,
        [this.trainImages.length / IMAGE_SIZE, IMAGE_H, IMAGE_W, 1]);
    const labels = tf.tensor2d(
        this.trainLabels, [this.trainLabels.length / NUM_CLASSES, NUM_CLASSES]);
    return {xs, labels};
  }
Get all training data as a data tensor and a labels tensor.

@returns
  xs: The data tensor, of shape `[numTrainExamples, 28, 28, 1]`.
  labels: The one-hot encoded labels tensor, of shape
    `[numTrainExamples, 10]`.