code: def test_serialize_bfloat16(
      use_legacy_bfloat16: bool, tensor_size: tuple
  ):
      hivemind.compression.base.USE_LEGACY_BFLOAT16 = (
          use_legacy_bfloat16
      )
      tensor = torch.randn(tensor_size, dtype=torch.bfloat16)
      _check(tensor, CompressionType.NONE)
      _check(
          tensor,
          CompressionType.BLOCKWISE_8BIT,
          rtol=0.1,
          atol=0.01,
          chunk_size=1024,
      )
  
imports: import multiprocessing
  from ctypes import c_int32
  import pytest
  import torch
  import torch.nn
  import hivemind
  from hivemind.compression import CompressionBase, CompressionInfo, Float16Compression, NoCompression, PerTensorCompression, RoleAdaptiveCompression, SizeAdaptiveCompression, Uniform8BitQuantization, deserialize_torch_tensor, serialize_torch_tensor
  from hivemind.compression.adaptive import AdaptiveCompressionBase
  from hivemind.proto.runtime_pb2 import CompressionType
  from hivemind.utils.streaming import combine_from_streaming, split_for_streaming
  from test_utils.dht_swarms import launch_dht_instances
label_desc: Use image node_id 5 for calling a global function with example usage: test_serialize_bfloat16(use_legacy_bfloat16, tensor_size) without return types