class_docstr: Image encoder of float32.
  
  Wrapper around `_ImageEncoder` which bitcast 1-channel float32 image
  into 4-channels uint8, so image can be encoded to PNG.
class_docstr_tok: ["Image","encoder","of","float32",".","Wrapper","around","`","_ImageEncoder","`","which","bitcast","1-channel","float32","image","into","4-channels","uint8",",","so","image","can","be","encoded","to","PNG","."]
code: def _encode_image(self, np_image: np.ndarray) -> bytes:
      _validate_np_array(
          np_image, shape=self._float_shape, dtype=np.float32
      )
      # Bitcast 1 channel float32 -> 4 channels uint8
      np_image = np_image.view(np.uint8)
      np_image = super()._encode_image(np_image)
      return np_image
  
imports: from __future__ import annotations
  import dataclasses
  import functools
  import io
  import os
  import tempfile
  from typing import Any, List, Optional, Type, Union
  from absl import logging
  from etils import epath
  import numpy
  from tensorflow_datasets.core import lazy_imports_lib
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import dtype_utils
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 3 for calling the _FloatImageEncoder obj's underlying member method code with example usage: obj._encode_image(np_image) and returns: np_image