class_docstr: A ``FrameworkModel`` implementation for inference with TensorFlow Serving.
docstr: Prepare the container definition.
  
  Args:
      instance_type: Instance type of the container.
      accelerator_type: Accelerator type, if applicable.
      serverless_inference_config (sagemaker.serverless.ServerlessInferenceConfig):
          Specifies configuration related to serverless endpoint. Instance type is
          not provided in serverless inference. So this is used to find image URIs.
      accept_eula (bool): For models that require a Model Access Config, specify True or
          False to indicate whether model terms of use have been accepted.
          The `accept_eula` value must be explicitly defined as `True` in order to
          accept the end-user license agreement (EULA) that some
          models require. (Default: None).
  
  Returns:
      A container definition for deploying a ``Model`` to an ``Endpoint``.
docstr_tok: ["Prepare","the","container","definition",".","Args",":","instance_type",":","Instance","type","of","the","container",".","accelerator_type",":","Accelerator","type",",","if","applicable",".","serverless_inference_config","(","sagemaker.serverless.ServerlessInferenceConfig",")",":","Specifies","configuration","related","to","serverless","endpoint",".","Instance","type","is","not","provided","in","serverless","inference",".","So","this","is","used","to","find","image","URIs",".","accept_eula","(","bool",")",":","For","models","that","require","a","Model","Access","Config",",","specify","True","or","False","to","indicate","whether","model","terms","of","use","have","been","accepted",".","The","`","accept_eula","`","value","must","be","explicitly","defined","as","`","True","`","in","order","to","accept","the","end-user","license","agreement","(","EULA",")","that","some","models","require",".","(","Default",":","None",")",".","Returns",":","A","container","definition","for","deploying","a","``","Model","``","to","an","``","Endpoint","``","."]
code: def prepare_container_def(
      self,
      instance_type=None,
      accelerator_type=None,
      serverless_inference_config=None,
      accept_eula=None,
  ):
      """Prepare the container definition.
  
      Args:
          instance_type: Instance type of the container.
          accelerator_type: Accelerator type, if applicable.
          serverless_inference_config (sagemaker.serverless.ServerlessInferenceConfig):
              Specifies configuration related to serverless endpoint. Instance type is
              not provided in serverless inference. So this is used to find image URIs.
          accept_eula (bool): For models that require a Model Access Config, specify True or
              False to indicate whether model terms of use have been accepted.
              The `accept_eula` value must be explicitly defined as `True` in order to
              accept the end-user license agreement (EULA) that some
              models require. (Default: None).
  
      Returns:
          A container definition for deploying a ``Model`` to an ``Endpoint``.
      """
      if not self.image_uri:
          if (
              instance_type is None
              and serverless_inference_config is None
          ):
              raise ValueError(
                  "Must supply either an instance type (for choosing CPU vs GPU) or an image URI."
              )
  
      image_uri = self._get_image_uri(
          instance_type,
          accelerator_type,
          serverless_inference_config=serverless_inference_config,
      )
      env = self._get_container_env()
  
      bucket, key_prefix = s3.determine_bucket_and_prefix(
          bucket=self.bucket,
          key_prefix=sagemaker.fw_utils.model_code_key_prefix(
              self.key_prefix, self.name, image_uri
          ),
          sagemaker_session=self.sagemaker_session,
      )
  
      if self.entry_point and not is_pipeline_variable(self.model_data):
          model_data = s3.s3_path_join(
              "s3://", bucket, key_prefix, "model.tar.gz"
          )
  
          sagemaker.utils.repack_model(
              self.entry_point,
              self.source_dir,
              self.dependencies,
              self.model_data,
              model_data,
              self.sagemaker_session,
              kms_key=self.model_kms_key,
          )
      elif self.entry_point and is_pipeline_variable(self.model_data):
          # model is not yet there, defer repacking to later during pipeline execution
          if isinstance(self.sagemaker_session, PipelineSession):
              self.sagemaker_session.context.need_runtime_repack.add(
                  id(self)
              )
              self.sagemaker_session.context.runtime_repack_output_prefix = s3.s3_path_join(
                  "s3://", bucket, key_prefix
              )
          else:
              logging.warning(
                  "The model_data is a Pipeline variable of type %s, "
                  "which should be used under `PipelineSession` and "
                  "leverage `ModelStep` to create or register model. "
                  "Otherwise some functionalities e.g. "
                  "runtime repack may be missing. For more, see: "
                  "https://sagemaker.readthedocs.io/en/stable/"
                  "amazon_sagemaker_model_building_pipeline.html#model-step",
                  type(self.model_data),
              )
          model_data = self.model_data
      else:
          model_data = self.model_data
  
      return sagemaker.container_def(
          image_uri,
          model_data,
          env,
          accept_eula=accept_eula,
      )
  
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 5 for calling the TensorFlowModel obj's underlying member method code with example usage: obj.prepare_container_def(instance_type, accelerator_type, serverless_inference_config, accept_eula) and returns: sagemaker