code: def test_serialize_tensor_properties(
      dtype: torch.dtype, requires_grad: bool
  ):
      tensor = torch.randn(123, 45, requires_grad=requires_grad).to(
          dtype
      )
      if dtype == torch.bfloat16:
          compression_types = [
              type
              for type in CompressionType.values()
              if type
              not in (
                  CompressionType.FLOAT16,
                  CompressionType.MEANSTD_16BIT,
              )
          ]
      elif torch.is_floating_point(
          tensor
      ):  # nb: complex and qint data types are not is_floating_point
          compression_types = CompressionType.values()
      else:
          compression_types = [CompressionType.NONE]
  
      for compression_type in compression_types:
          _check(tensor, compression_type, atol=float("inf"))
  
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 4 for calling a global function with example usage: test_serialize_tensor_properties(dtype, requires_grad) without return types