code: def create_embed_batch_size_evaluator(
      features_to_encode: List[FeatureConfigDict],
      metadata: TrainingSetMetadataDict,
  ) -> BatchSizeEvaluator:
      class _EmbedBatchSizeEvaluator(BatchSizeEvaluator):
          def __init__(self):
              embedder = Embedder(features_to_encode, metadata)
              self.device = get_torch_device()
              self.embedder = embedder.to(self.device)
              self.embedder.eval()
  
          def step(self, batch_size: int):
              inputs = {
                  input_feature_name: input_feature.create_sample_input(
                      batch_size=batch_size
                  ).to(self.device)
                  for input_feature_name, input_feature in self.embedder.input_features.items()
              }
              with torch.no_grad():
                  self.embedder(inputs)
  
      return _EmbedBatchSizeEvaluator
  
imports: from typing import Callable, Dict, List
  import numpy
  import pandas
  import torch
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import ENCODER_OUTPUT, MODEL_ECD, NAME, PROC_COLUMN, TYPE
  from ludwig.features.feature_registries import get_input_type_registry
  from ludwig.features.feature_utils import LudwigFeatureDict
  from ludwig.models.base import BaseModel
  from ludwig.schema.features.base import BaseInputFeatureConfig, FeatureCollection
  from ludwig.schema.features.utils import get_input_feature_cls
  from ludwig.types import FeatureConfigDict, TrainingSetMetadataDict
  from ludwig.utils.batch_size_tuner import BatchSizeEvaluator
  from ludwig.utils.dataframe_utils import from_numpy_dataset
  from ludwig.utils.misc_utils import get_from_registry
  from ludwig.utils.torch_utils import get_torch_device, LudwigModule
label_desc: Use image node_id 1 for calling a global function with example usage: create_embed_batch_size_evaluator(features_to_encode, metadata) and returns: _EmbedBatchSizeEvaluator