docstr: a predict_multiple dispatching tf serving requests with the correct mode
  It takes a dictionary of numpy arrays of shape (Nitems, ?) and returns a
   dictionary for the same shape, indexed by self.output_keys
docstr_tok: ["a","predict_multiple","dispatching","tf","serving","requests","with","the","correct","mode","It","takes","a","dictionary","of","numpy","arrays","of","shape","(","Nitems",",","?",")","and","returns","a","dictionary","for","the","same","shape",",","indexed","by","self.output_keys"]
code: def _tensorflow_predict(
      self, vects: Dict[str, "np.ndarray"], grpc_dtype=None
  ) -> Dict[str, "np.ndarray"]:
      """
      a predict_multiple dispatching tf serving requests with the correct mode
      It takes a dictionary of numpy arrays of shape (Nitems, ?) and returns a
       dictionary for the same shape, indexed by self.output_keys
      """
      if self.service_settings.tf_serving.enable:
          if self.service_settings.tf_serving.mode == "grpc":
              return self._tensorflow_predict_grpc(
                  vects, dtype=grpc_dtype
              )
          if self.service_settings.tf_serving.mode == "rest":
              return self._tensorflow_predict_rest(vects)
      return self._tensorflow_predict_local(vects)
  
imports: import abc
  import json
  import os
  from typing import Any, Dict, List, Optional, Tuple, Type
  import aiohttp
  import requests
  from structlog import get_logger
  from tenacity import Retrying, retry_if_exception, stop_after_attempt, wait_random_exponential
  from modelkit.core.model import AsyncModel, Model
  from modelkit.core.types import ItemType, ReturnType
  from modelkit.utils.serialization import safe_np_dump
label_desc: Use image node_id 3 for calling the TensorflowModel obj's underlying member method code with example usage: obj._tensorflow_predict(vects, grpc_dtype) and returns: self, self, self