code: def test_serialization(self) -> None:
      # ml
      x1 = np.random.random([100, 2])
      x2 = np.random.randint(0, 3, [100, 1])
      x = np.hstack([x1, x2, x1])
      y = np.random.random([100, 3])
      m = cflearn.api.fit_ml(
          x,
          y,
          config=cflearn.MLConfig(
              model_name="fcnn",
              model_config=dict(
                  input_dim=x.shape[1], output_dim=y.shape[1]
              ),
              loss_name="mae",
              encoder_settings={"2": cflearn.MLEncoderSettings(3)},
          ),
          debug=True,
      )
      loader = m.data.build_loader(x)
      p = m.predict(loader)[cflearn.PREDICTIONS_KEY]
      name = "test_serialization.ml"
      cflearn.DLPipelineSerializer.save(m, name, compress=True)
      m2 = cflearn.api.load_inference(name)
      loader = m2.data.build_loader(x)
      p2 = m2.predict(loader)[cflearn.PREDICTIONS_KEY]
      assert np.allclose(p, p2)
      cflearn.DLPipelineSerializer.save(m2, name, compress=True)
      m3 = cflearn.api.load_inference(name)
      loader = m3.data.build_loader(x)
      p3 = m3.predict(loader)[cflearn.PREDICTIONS_KEY]
      assert np.allclose(p2, p3)
  
file_path: carefree-learn/tests/test_pipeline.py
imports: import os
  import torch
  import cflearn
  import unittest
  import numpy
label_desc: Use image node_id 5 for calling the TestPipeline obj's underlying member method code with example usage: obj.test_serialization() without return types