code: def test_error_if_no_input(tmpdir):
      """Test that an error is thrown when there is no input tensor."""
      model = BoringModel()
      model.example_input_array = None
      file_path = os.path.join(tmpdir, "model.onnx")
      with pytest.raises(
          ValueError,
          match=r"Could not export to ONNX since neither `input_sample` nor"
          r" `model.example_input_array` attribute is set.",
      ):
          model.to_onnx(file_path)
  
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 6 for calling a global function with example usage: test_error_if_no_input(tmpdir) without return types