code: def test_saved_weights_in_checkpoint(tmpdir):
      image_dest_folder = os.path.join(tmpdir, "generated_images")
      input_features = [
          text_feature(),
          image_feature(image_dest_folder),
      ]
      output_features = [
          category_feature(name="class", output_feature=True)
      ]
  
      data_csv = generate_data(
          input_features,
          output_features,
          os.path.join(tmpdir, "dataset.csv"),
      )
      val_csv = shutil.copyfile(
          data_csv, os.path.join(tmpdir, "validation.csv")
      )
      test_csv = shutil.copyfile(
          data_csv, os.path.join(tmpdir, "test.csv")
      )
  
      config = {
          "input_features": input_features,
          "output_features": output_features,
          TRAINER: {BATCH_SIZE: 128},
      }
      model = LudwigModel(config)
      _, _, output_dir = model.train(
          training_set=data_csv,
          validation_set=val_csv,
          test_set=test_csv,
          output_directory=tmpdir,
      )
  
      config_save_path = os.path.join(
          output_dir, "model", MODEL_HYPERPARAMETERS_FILE_NAME
      )
      with open(config_save_path) as f:
          saved_config = json.load(f)
      saved_input_features = saved_config["input_features"]
      for saved_input_feature in saved_input_features:
          assert "encoder" in saved_input_feature
          input_feature_encoder = saved_input_feature["encoder"]
          assert "saved_weights_in_checkpoint" in input_feature_encoder
          assert input_feature_encoder["saved_weights_in_checkpoint"]
  
imports: import json
  import os
  import shutil
  from unittest import mock
  import pandas
  import pytest
  import torch
  import yaml
  from ludwig.api import LudwigModel
  from ludwig.callbacks import Callback
  from ludwig.constants import BATCH_SIZE, ENCODER, TRAINER, TYPE
  from ludwig.globals import MODEL_HYPERPARAMETERS_FILE_NAME
  from ludwig.models.inference import InferenceModule
  from ludwig.utils.data_utils import read_csv
  from tests.integration_tests.utils import category_feature, ENCODERS, generate_data, get_weights, image_feature, run_api_experiment, sequence_feature, text_feature
label_desc: Use image node_id 19 for calling a global function with example usage: test_saved_weights_in_checkpoint(tmpdir) without return types