code: def _check(
      tensor, compression, rtol=1e-5, atol=1e-8, chunk_size=30 * 1024
  ):
      serialized_tensor = serialize_torch_tensor(tensor, compression)
      chunks = list(split_for_streaming(serialized_tensor, chunk_size))
      assert len(chunks) == max(
          (len(serialized_tensor.buffer) - 1) // chunk_size + 1, 1
      )
      restored = combine_from_streaming(chunks)
      result = deserialize_torch_tensor(restored)
      assert result.dtype == tensor.dtype, compression
      assert result.requires_grad == tensor.requires_grad
      assert torch.allclose(result, tensor, rtol=rtol, atol=atol)
  
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 2 for calling a global function with example usage: _check(tensor, compression, rtol, atol, chunk_size) without return types