code: def main(gpu_env: Optional[bool], smoke_run: Optional[bool]):
      test_name = "resnet50_cpu"
      device = "cpu"
      if gpu_env:
          test_name = "resnet50_gpu"
          device = "cuda"
          ImageObjectioner.set_options(
              ray_actor_options={"num_gpus": 1}
          )
  
      # batch size
      batch_sizes = [16, 32, 64]
  
      io = ImageObjectioner.bind(DataDownloader.bind(), device=device)
      handle = serve.run(io)
  
      if smoke_run:
          res = handle.predict.remote(input_uris)
          print(res.result())
  
      else:
          result = {}
          print("warming up...")
          for _ in range(10):
              handle.predict.remote([input_uris[0]]).result()
  
          print("start load testing...")
          for batch_size in batch_sizes:
              (
                  throughput_mean_tps,
                  model_inference_latency_mean,
              ) = asyncio.run(
                  trial(measure_http_throughput_tps, batch_size)
              )
              result[f"batch size {batch_size}"] = {
                  "throughput_mean_tps": throughput_mean_tps,
                  "model_inference_latency_mean": model_inference_latency_mean,
              }
              print(throughput_mean_tps, model_inference_latency_mean)
  
          save_test_results(
              {test_name: result},
              default_output_file="/tmp/serve_resent_benchmark.json",
          )
  
file_path: ray/release/serve_tests/workloads/serve_resnet_benchmark.py
imports: import os
  from typing import List, Optional
  import asyncio
  import time
  import aiohttp
  import click
  import numpy
  import starlette.requests
  import torch
  from torchvision import models
  from ray import serve
  from ray.serve.handle import DeploymentHandle
  from serve_test_utils import save_test_results
label_desc: Use image node_id 1 for calling a global function with example usage: main(gpu_env, smoke_run) without return types