class_docstr: ImageDecoderInterface implementation based on tensorflow library.
  
  This image decoder only supports image formats supported by:
  tf.image.decode_image, ['bmp', 'gif', 'jpeg', 'png'].
  
  Image sizes are computed using tf.image.decode_image, which requires tf.
  Initializating and pickling tf objects can be non-trivial, so:
  - Initialization is done lazily when get_sizes computation is needed.
  - __reduce__() is overridden so that tf state is ignored. It is lazily
    initialized as needed, after deserialization.
code: def _initialize_lazy_get_sizes_callable(self):
      # Initialize the tensorflow graph for decoding images.
      graph = tf.Graph()
      self._session = tf.compat.v1.Session(graph=graph)
  
      def get_image_shape(value):
          image_shape = tf.shape(input=tf.image.decode_image(value))
          # decode_image returns a 3-D array ([height, width, num_channels]) for
          # BMP/JPEG/PNG images, but 4-D array ([num_frames, height, width, 3])
          # for GIF images.
          return tf.cond(
              pred=tf.equal(tf.size(input=image_shape), 4),
              true_fn=lambda: image_shape[1:3],
              false_fn=lambda: image_shape[0:2],
          )
  
      with self._session.graph.as_default(), self._session.as_default():
          self._batch_image_input = tf.compat.v1.placeholder(
              dtype=tf.string, shape=[None]
          )
          self._image_shapes = tf.map_fn(
              get_image_shape,
              elems=self._batch_image_input,
              dtype=tf.int32,
              infer_shape=False,
          )
          graph.finalize()
      self._lazy_get_sizes_callable = self._session.make_callable(
          fetches=self._image_shapes,
          feed_list=[self._batch_image_input],
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import collections
  from typing import Iterable, List, Optional, Text
  import numpy
  import pandas
  import pyarrow
  import six
  import tensorflow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import stats_util
  from tfx_bsl.arrow import array_util
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 3 for calling the TfImageDecoder obj's underlying member method code with example usage: obj._initialize_lazy_get_sizes_callable() and returns: tf