code: def compute_inference_batch_size(
      per_gpu_batch_size: int,
      eval_batch_size_ratio: Union[int, float],
      per_gpu_batch_size_evaluation: int,
      num_gpus: int,
      strategy: str,
  ):
      """
      Compute the batch size for inference.
  
      Parameters
      ----------
      per_gpu_batch_size
          Per gpu batch size from the config.
      eval_batch_size_ratio
          per_gpu_batch_size_evaluation = per_gpu_batch_size * eval_batch_size_ratio.
      per_gpu_batch_size_evaluation
          Per gpu evaluation batch size from the config.
      num_gpus
          Number of GPUs.
      strategy
          A pytorch lightning strategy.
  
      Returns
      -------
      Batch size for inference.
      """
      if per_gpu_batch_size_evaluation:
          batch_size = per_gpu_batch_size_evaluation
      else:
          batch_size = per_gpu_batch_size * eval_batch_size_ratio
  
      if num_gpus > 1 and strategy == "dp":
          # If using 'dp', the per_gpu_batch_size would be split by all GPUs.
          # So, we need to use the GPU number as a multiplier to compute the batch size.
          batch_size = batch_size * num_gpus
  
      return batch_size
  
imports: import contextlib
  import logging
  import math
  import sys
  import warnings
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from lightning.pytorch.accelerators import find_usable_cuda_devices
  from torch import nn
  from autogluon.common.utils.resource_utils import ResourceManager
  from ..constants import DDP_STRATEGIES, OBJECT_DETECTION, OCR
label_desc: Use image node_id 7 for calling a global function with example usage: compute_inference_batch_size(per_gpu_batch_size, eval_batch_size_ratio, per_gpu_batch_size_evaluation, num_gpus, strategy) and returns: batch_size