class_docstr: Visitor optimizes the operation graph (see nodes.py).
  
  This operates on the translated graph which is emitted by the
  `_TranslateVisitor`, and performs optimizations.
  
  Namely, when enabled, this enables reading and writing from/to analyzer
  accumulator cache to avoid recomputing them over already seen datasets.
  This type of optimization requires also creating a partitioned view of the
  input data, according to the `is_partitionable` annotation.
code: def _visit_apply_savedmodel_operation(
      self, operation_def, upstream_views
  ):
      if any(v.fine_grained_view for v in upstream_views):
          raise ValueError(
              "Was not expecting a fine_grained_view input for ApplySavedModel"
          )
      (
          saved_model_path_upstream_view,
          input_upstream_view,
      ) = upstream_views
  
      fine_grained_view = collections.OrderedDict()
      for dataset_idx, dataset_key in enumerate(
          self._sorted_dataset_keys
      ):
          infix = f"AnalysisIndex{dataset_idx}"
          input_node = nodes.apply_operation(
              beam_nodes.ExtractInputForSavedModel,
              dataset_key=dataset_key,
              label=f"ExtractInputForSavedModel[{infix}]",
          )
          # We use an index for the label in order to make beam labels more stable.
          (fine_grained_view[dataset_key],) = nodes.OperationNode(
              operation_def._replace(
                  label=f"{operation_def.label}[{infix}]"
              ),
              (
                  saved_model_path_upstream_view.flattened_view,
                  input_node,
              ),
          ).outputs
  
      (flattened_view,) = nodes.OperationNode(
          operation_def,
          (
              saved_model_path_upstream_view.flattened_view,
              input_upstream_view.flattened_view,
          ),
      ).outputs
  
      return (
          _OptimizationView(
              prefer_fine_grained_view=False,
              flattened_view=flattened_view,
              fine_grained_view=fine_grained_view,
              hashed_path=b"APPLY_SAVEDMODEL",
          ),
      )
  
imports: import collections
  import dataclasses
  import hashlib
  from typing import Collection, Dict, Mapping, Optional, Tuple
  from typing import OrderedDict
  import tensorflow
  from tensorflow_transform import analyzer_nodes
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_tools
  from tensorflow_transform import impl_helper
  from tensorflow_transform import nodes
  from tensorflow_transform import tf2_utils
  from tensorflow_transform import tf_utils
  from tensorflow_transform.beam import analyzer_cache
  from tensorflow_transform.beam import beam_nodes
  from tensorflow_transform.beam import combiner_packing_util
label_desc: Use image node_id 8 for calling the _OptimizeVisitor obj's underlying member method code with example usage: obj._visit_apply_savedmodel_operation(operation_def, upstream_views) and returns: _OptimizationView