class_docstr: SageMaker ``MultiDataModel`` can be used to deploy multiple models to the same ``Endpoint``.
  
  And also deploy additional models to an existing SageMaker multi-model ``Endpoint``
class_docstr_tok: ["SageMaker","``","MultiDataModel","``","can","be","used","to","deploy","multiple","models","to","the","same","``","Endpoint","``",".","And","also","deploy","additional","models","to","an","existing","SageMaker","multi-model","``","Endpoint","``"]
docstr: Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``.
  
  Create a SageMaker ``Model`` and ``EndpointConfig``, and deploy an
  ``Endpoint`` from this ``Model``. If self.model is not None, then the ``Endpoint``
  will be deployed with parameters in self.model (like vpc_config,
  enable_network_isolation, etc).  If self.model is None, then use the parameters
  in ``MultiDataModel`` constructor will be used. If ``self.predictor_cls`` is not
  None, this method returns a the result of invoking ``self.predictor_cls`` on
  the created endpoint name.
  
  The name of the created model is accessible in the ``name`` field of
  this ``Model`` after deploy returns
  
  The name of the created endpoint is accessible in the
  ``endpoint_name`` field of this ``Model`` after deploy returns.
  
  Args:
      initial_instance_count (int): The initial number of instances to run
          in the ``Endpoint`` created from this ``Model``.
      instance_type (str): The EC2 instance type to deploy this Model to.
          For example, 'ml.p2.xlarge', or 'local' for local mode.
      serializer (:class:`~sagemaker.serializers.BaseSerializer`): A
          serializer object, used to encode data for an inference endpoint
          (default: None). If ``serializer`` is not None, then
          ``serializer`` will override the default serializer. The
          default serializer is set by the ``predictor_cls``.
      deserializer (:class:`~sagemaker.deserializers.BaseDeserializer`): A
          deserializer object, used to decode data from an inference
          endpoint (default: None). If ``deserializer`` is not None, then
          ``deserializer`` will override the default deserializer. The
          default deserializer is set by the ``predictor_cls``.
      accelerator_type (str): Type of Elastic Inference accelerator to
          deploy this model for model loading and inference, for example,
          'ml.eia1.medium'. If not specified, no Elastic Inference
          accelerator will be attached to the endpoint. For more
          information:
          https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
      endpoint_name (str): The name of the endpoint to create (default:
          None). If not specified, a unique endpoint name will be created.
      tags (List[dict[str, str]]): The list of tags to attach to this
          specific endpoint.
      kms_key (str): The ARN of the KMS key that is used to encrypt the
          data on the storage volume attached to the instance hosting the
          endpoint.
      wait (bool): Whether the call should wait until the deployment of
          this model completes (default: True).
      data_capture_config (sagemaker.model_monitor.DataCaptureConfig): Specifies
          configuration related to Endpoint data capture for use with
          Amazon SageMaker Model Monitoring. Default: None.
  
  Returns:
      callable[string, sagemaker.session.Session] or None: Invocation of
          ``self.predictor_cls`` on the created endpoint name,
          if ``self.predictor_cls``
          is not None. Otherwise, return None.
docstr_tok: ["Deploy","this","``","Model","``","to","an","``","Endpoint","``","and","optionally","return","a","``","Predictor","``",".","Create","a","SageMaker","``","Model","``","and","``","EndpointConfig","``",",","and","deploy","an","``","Endpoint","``","from","this","``","Model","``",".","If","self.model","is","not","None",",","then","the","``","Endpoint","``","will","be","deployed","with","parameters","in","self.model","(","like","vpc_config",",","enable_network_isolation",",","etc",")",".","If","self.model","is","None",",","then","use","the","parameters","in","``","MultiDataModel","``","constructor","will","be","used",".","If","``","self.predictor_cls","``","is","not","None",",","this","method","returns","a","the","result","of","invoking","``","self.predictor_cls","``","on","the","created","endpoint","name",".","The","name","of","the","created","model","is","accessible","in","the","``","name","``","field","of","this","``","Model","``","after","deploy","returns","The","name","of","the","created","endpoint","is","accessible","in","the","``","endpoint_name","``","field","of","this","``","Model","``","after","deploy","returns",".","Args",":","initial_instance_count","(","int",")",":","The","initial","number","of","instances","to","run","in","the","``","Endpoint","``","created","from","this","``","Model","``",".","instance_type","(","str",")",":","The","EC2","instance","type","to","deploy","this","Model","to",".","For","example",",","'ml.p2.xlarge","'",",","or","'local","'","for","local","mode",".","serializer","(",":","class",":","`","~sagemaker.serializers.BaseSerializer","`",")",":","A","serializer","object",",","used","to","encode","data","for","an","inference","endpoint","(","default",":","None",")",".","If","``","serializer","``","is","not","None",",","then","``","serializer","``","will","override","the","default","serializer",".","The","default","serializer","is","set","by","the","``","predictor_cls","``",".","deserializer","(",":","class",":","`","~sagemaker.deserializers.BaseDeserializer","`",")",":","A","deserializer","object",",","used","to","decode","data","from","an","inference","endpoint","(","default",":","None",")",".","If","``","deserializer","``","is","not","None",",","then","``","deserializer","``","will","override","the","default","deserializer",".","The","default","deserializer","is","set","by","the","``","predictor_cls","``",".","accelerator_type","(","str",")",":","Type","of","Elastic","Inference","accelerator","to","deploy","this","model","for","model","loading","and","inference",",","for","example",",","'ml.eia1.medium","'",".","If","not","specified",",","no","Elastic","Inference","accelerator","will","be","attached","to","the","endpoint",".","For","more","information",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/ei.html","endpoint_name","(","str",")",":","The","name","of","the","endpoint","to","create","(","default",":","None",")",".","If","not","specified",",","a","unique","endpoint","name","will","be","created",".","tags","(","List","[","dict","[","str",",","str","]","]",")",":","The","list","of","tags","to","attach","to","this","specific","endpoint",".","kms_key","(","str",")",":","The","ARN","of","the","KMS","key","that","is","used","to","encrypt","the","data","on","the","storage","volume","attached","to","the","instance","hosting","the","endpoint",".","wait","(","bool",")",":","Whether","the","call","should","wait","until","the","deployment","of","this","model","completes","(","default",":","True",")",".","data_capture_config","(","sagemaker.model_monitor.DataCaptureConfig",")",":","Specifies","configuration","related","to","Endpoint","data","capture","for","use","with","Amazon","SageMaker","Model","Monitoring",".","Default",":","None",".","Returns",":","callable","[","string",",","sagemaker.session.Session","]","or","None",":","Invocation","of","``","self.predictor_cls","``","on","the","created","endpoint","name",",","if","``","self.predictor_cls","``","is","not","None",".","Otherwise",",","return","None","."]
code: def deploy(
      self,
      initial_instance_count,
      instance_type,
      serializer=None,
      deserializer=None,
      accelerator_type=None,
      endpoint_name=None,
      tags=None,
      kms_key=None,
      wait=True,
      data_capture_config=None,
      **kwargs,
  ):
      """Deploy this ``Model`` to an ``Endpoint`` and optionally return a ``Predictor``.
  
      Create a SageMaker ``Model`` and ``EndpointConfig``, and deploy an
      ``Endpoint`` from this ``Model``. If self.model is not None, then the ``Endpoint``
      will be deployed with parameters in self.model (like vpc_config,
      enable_network_isolation, etc).  If self.model is None, then use the parameters
      in ``MultiDataModel`` constructor will be used. If ``self.predictor_cls`` is not
      None, this method returns a the result of invoking ``self.predictor_cls`` on
      the created endpoint name.
  
      The name of the created model is accessible in the ``name`` field of
      this ``Model`` after deploy returns
  
      The name of the created endpoint is accessible in the
      ``endpoint_name`` field of this ``Model`` after deploy returns.
  
      Args:
          initial_instance_count (int): The initial number of instances to run
              in the ``Endpoint`` created from this ``Model``.
          instance_type (str): The EC2 instance type to deploy this Model to.
              For example, 'ml.p2.xlarge', or 'local' for local mode.
          serializer (:class:`~sagemaker.serializers.BaseSerializer`): A
              serializer object, used to encode data for an inference endpoint
              (default: None). If ``serializer`` is not None, then
              ``serializer`` will override the default serializer. The
              default serializer is set by the ``predictor_cls``.
          deserializer (:class:`~sagemaker.deserializers.BaseDeserializer`): A
              deserializer object, used to decode data from an inference
              endpoint (default: None). If ``deserializer`` is not None, then
              ``deserializer`` will override the default deserializer. The
              default deserializer is set by the ``predictor_cls``.
          accelerator_type (str): Type of Elastic Inference accelerator to
              deploy this model for model loading and inference, for example,
              'ml.eia1.medium'. If not specified, no Elastic Inference
              accelerator will be attached to the endpoint. For more
              information:
              https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
          endpoint_name (str): The name of the endpoint to create (default:
              None). If not specified, a unique endpoint name will be created.
          tags (List[dict[str, str]]): The list of tags to attach to this
              specific endpoint.
          kms_key (str): The ARN of the KMS key that is used to encrypt the
              data on the storage volume attached to the instance hosting the
              endpoint.
          wait (bool): Whether the call should wait until the deployment of
              this model completes (default: True).
          data_capture_config (sagemaker.model_monitor.DataCaptureConfig): Specifies
              configuration related to Endpoint data capture for use with
              Amazon SageMaker Model Monitoring. Default: None.
  
      Returns:
          callable[string, sagemaker.session.Session] or None: Invocation of
              ``self.predictor_cls`` on the created endpoint name,
              if ``self.predictor_cls``
              is not None. Otherwise, return None.
      """
      removed_kwargs("update_endpoint", kwargs)
      # Set model specific parameters
      if self.model:
          enable_network_isolation = (
              self.model.enable_network_isolation()
          )
          role = self.model.role
          vpc_config = self.model.vpc_config
          predictor_cls = self.model.predictor_cls
      else:
          enable_network_isolation = self.enable_network_isolation()
          role = self.role
          vpc_config = self.vpc_config
          predictor_cls = self.predictor_cls
  
      if role is None:
          raise ValueError("Role can not be null for deploying a model")
  
      if instance_type == "local" and not isinstance(
          self.sagemaker_session, local.LocalSession
      ):
          self.sagemaker_session = local.LocalSession()
  
      tags = format_tags(tags)
  
      container_def = self.prepare_container_def(
          instance_type, accelerator_type=accelerator_type
      )
      self.sagemaker_session.create_model(
          self.name,
          role,
          container_def,
          vpc_config=vpc_config,
          enable_network_isolation=enable_network_isolation,
          tags=tags,
      )
  
      production_variant = sagemaker.production_variant(
          self.name,
          instance_type,
          initial_instance_count,
          accelerator_type=accelerator_type,
      )
      if endpoint_name:
          self.endpoint_name = endpoint_name
      else:
          self.endpoint_name = self.name
  
      data_capture_config_dict = None
      if data_capture_config is not None:
          data_capture_config_dict = (
              data_capture_config._to_request_dict()
          )
  
      self.sagemaker_session.endpoint_from_production_variants(
          name=self.endpoint_name,
          production_variants=[production_variant],
          tags=tags,
          kms_key=kms_key,
          wait=wait,
          data_capture_config_dict=data_capture_config_dict,
      )
  
      if predictor_cls:
          predictor = predictor_cls(
              self.endpoint_name, self.sagemaker_session
          )
          if serializer:
              predictor.serializer = serializer
          if deserializer:
              predictor.deserializer = deserializer
          return predictor
      return None
  
file_path: sagemaker-python-sdk/src/sagemaker/multidatamodel.py
imports: from __future__ import absolute_import
  import os
  from typing import Union, Optional
  from six.moves.urllib.parse import urlparse
  import sagemaker
  from sagemaker import local, s3
  from sagemaker.deprecations import removed_kwargs
  from sagemaker.model import Model
  from sagemaker.session import Session
  from sagemaker.utils import pop_out_unused_kwarg, format_tags
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 3 for calling the MultiDataModel obj's underlying member method code with example usage: obj.deploy(initial_instance_count, instance_type, serializer, deserializer, accelerator_type, endpoint_name, tags, kms_key, wait, data_capture_config) and returns: None, predictor