code: def compress(
      self,
      tensor: torch.Tensor,
      info: CompressionInfo,
      allow_inplace: bool = False,
  ) -> runtime_pb2.Tensor:
      if (
          not torch.is_floating_point(tensor)
          or tensor.dtype == torch.bfloat16
      ):
          raise ValueError(
              f"{self.__class__.__name__} does not support {tensor.dtype} tensors"
          )
      requires_grad = tensor.requires_grad
      tensor = tensor.detach().cpu()
      dtype_name = tensor.numpy().dtype.name
      tensor = tensor.to(torch.float32, copy=not allow_inplace)
      tensor = tensor.clamp_(self.FP16_MIN, self.FP16_MAX).to(
          torch.float16
      )
      return runtime_pb2.Tensor(
          compression=self.compression_type,
          buffer=tensor.numpy().tobytes(),
          size=tensor.shape,
          dtype=dtype_name,
          requires_grad=requires_grad,
      )
  
file_path: hivemind/hivemind/compression/floating.py
imports: import math
  import numpy
  import torch
  from hivemind.compression.base import CompressionBase, CompressionInfo
  from hivemind.proto import runtime_pb2
label_desc: Use image node_id 1 for calling the Float16Compression obj's underlying member method code with example usage: obj.compress(tensor, info, allow_inplace) and returns: runtime_pb2