class_docstr: A ``Predictor`` implementation for inference against TensorFlow Serving endpoints.
docstr: Placeholder docstring.
docstr_tok: ["Placeholder","docstring","."]
code: def _classify_or_regress(self, data, method):
      """Placeholder docstring."""
      if method not in ["classify", "regress"]:
          raise ValueError(
              "invalid TensorFlow Serving method: {}".format(method)
          )
  
      if self.content_type != "application/json":
          raise ValueError(
              "The {} api requires json requests.".format(method)
          )
  
      args = {"CustomAttributes": "tfs-method={}".format(method)}
  
      return self.predict(data, args)
  
imports: from __future__ import absolute_import
  import logging
  from typing import Union, Optional, List, Dict
  import sagemaker
  from sagemaker import image_uris, s3, ModelMetrics
  from sagemaker.deserializers import JSONDeserializer
  from sagemaker.deprecations import removed_kwargs
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.metadata_properties import MetadataProperties
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import JSONSerializer
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.workflow.pipeline_context import PipelineSession
  from sagemaker.utils import format_tags
label_desc: Use image node_id 4 for calling the TensorFlowPredictor obj's underlying member method code with example usage: obj._classify_or_regress(data, method) and returns: self