code: def test_serialize():
      bbox = BBox()
      assert bbox.serialize(torch.ones(4)) == [1.0, 1.0, 1.0, 1.0]
      assert bbox.serialize(torch.zeros((1, 4))) == [0.0, 0.0, 0.0, 0.0]
      with pytest.raises(ValueError):
          # dimension
          assert bbox.serialize(torch.ones((2, 4)))
      with pytest.raises(TypeError):
          # unsupported type
          bbox.serialize(torch.randn(1, 4, dtype=torch.cfloat))
  
imports: import pytest
  import torch
  from flash.core.serve.types import BBox
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 2 for calling a global function with example usage: test_serialize() without return types