class_docstr: Compress all floating point gradients to 16-bit.
class_docstr_tok: ["Compress","all","floating","point","gradients","to","16-bit","."]
docstr: Downcasts the tensor to 16-bit.
docstr_tok: ["Downcasts","the","tensor","to","16-bit","."]
code: def compress(tensor):
      """Downcasts the tensor to 16-bit."""
      tensor_compressed = tensor
      if "float" in str(tensor.dtype):
          # Only allow compression from other floating point types
          tensor_compressed = tensor.astype("float16", copy=False)
      return tensor_compressed, tensor.dtype
  
file_path: horovod/horovod/mxnet/compression.py
label_desc: Use image node_id 1 for calling the FP16Compressor obj's underlying member method code with example usage: obj.compress(tensor) and returns: tensor_compressed,  tensor