code: def test_model_saves_on_gpu(tmpdir, accelerator):
      """Test that model saves on gpu."""
      model = BoringModel()
      trainer = Trainer(
          accelerator=accelerator, devices=1, fast_dev_run=True
      )
      trainer.fit(model)
  
      file_path = os.path.join(tmpdir, "model.onnx")
      input_sample = torch.randn((1, 32))
      model.to_onnx(file_path, input_sample)
      assert os.path.isfile(file_path)
      assert os.path.getsize(file_path) > 4e2
  
file_path: pytorch-lightning/tests/tests_pytorch/models/test_onnx.py
imports: import operator
  import os
  from unittest.mock import patch
  import numpy
  import onnxruntime
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning_utilities import compare_version
  import tests_pytorch.helpers.pipelines
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.utilities.test_model_summary import UnorderedModel
label_desc: Use image node_id 2 for calling a global function with example usage: test_model_saves_on_gpu(tmpdir, accelerator) without return types