class_docstr: Implements Horovod's Compression.
class_docstr_tok: ["Implements","Horovod","'s","Compression","."]
code: def _compress(self, tensor: Tensor):
      self.dtype = tensor.dtype
      tensor_compressed = tensor
      if tensor.dtype.is_floating:
          # Only allow compression from other floating point types
          # TODO: dtypes.float16 if using TF2.1.x (errors in 2.0)
          tensor_compressed = math_ops.cast(tensor, dtypes.float32)
      return tensor_compressed
  
imports: from abc import ABC, abstractmethod
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework.ops import Tensor
  from tensorflow.python.ops import collective_ops, math_ops
label_desc: Use image node_id 3 for calling the HorovodCompressor obj's underlying member method code with example usage: obj._compress(tensor) and returns: tensor_compressed