class_docstr: An PyTorch SageMaker ``Model`` that can be deployed to a SageMaker ``Endpoint``.
class_docstr_tok: ["An","PyTorch","SageMaker","``","Model","``","that","can","be","deployed","to","a","SageMaker","``","Endpoint","``","."]
docstr: Creates a model package for creating SageMaker models or listing on Marketplace.
  
  Args:
      content_types (list[str] or list[PipelineVariable]): The supported MIME types
          for the input data.
      response_types (list[str] or list[PipelineVariable]): The supported MIME types
          for the output data.
      inference_instances (list[str] or list[PipelineVariable]): A list of the
          instance types that are used to generate inferences in real-time (default: None).
      transform_instances (list[str] or list[PipelineVariable]): A list of the
          instance types on which a transformation job can be run or on which an
          endpoint can be deployed (default: None).
      model_package_name (str or PipelineVariable): Model Package name, exclusive to
          `model_package_group_name`, using `model_package_name` makes the Model Package
          un-versioned (default: None).
      model_package_group_name (str or PipelineVariable): Model Package Group name, exclusive
          to `model_package_name`, using `model_package_group_name` makes the Model Package
          versioned (default: None).
      image_uri (str or PipelineVariable): Inference image uri for the container.
          Model class' self.image will be used if it is None (default: None).
      model_metrics (ModelMetrics): ModelMetrics object (default: None).
      metadata_properties (MetadataProperties): MetadataProperties object (default: None).
      marketplace_cert (bool): A boolean value indicating if the Model Package is certified
          for AWS Marketplace (default: False).
      approval_status (str or PipelineVariable): Model Approval Status, values can be
          "Approved", "Rejected", or "PendingManualApproval"
          (default: "PendingManualApproval").
      description (str): Model Package description (default: None).
      drift_check_baselines (DriftCheckBaselines): DriftCheckBaselines object (default: None).
      customer_metadata_properties (dict[str, str] or dict[str, PipelineVariable]):
          A dictionary of key-value paired metadata properties (default: None).
      domain (str or PipelineVariable): Domain values can be "COMPUTER_VISION",
          "NATURAL_LANGUAGE_PROCESSING", "MACHINE_LEARNING" (default: None).
      sample_payload_url (str or PipelineVariable): The S3 path where the sample payload
          is stored (default: None).
      task (str or PipelineVariable): Task values which are supported by Inference Recommender
          are "FILL_MASK", "IMAGE_CLASSIFICATION", "OBJECT_DETECTION", "TEXT_GENERATION",
          "IMAGE_SEGMENTATION", "CLASSIFICATION", "REGRESSION", "OTHER" (default: None).
      framework (str or PipelineVariable): Machine learning framework of the model package
          container image (default: None).
      framework_version (str or PipelineVariable): Framework version of the Model Package
          Container Image (default: None).
      nearest_model_name (str or PipelineVariable): Name of a pre-trained machine learning
          benchmarked by Amazon SageMaker Inference Recommender (default: None).
      data_input_configuration (str or PipelineVariable): Input object for the model
          (default: None).
      skip_model_validation (str or PipelineVariable): Indicates if you want to skip model
          validation. Values can be "All" or "None" (default: None).
  
  Returns:
      A `sagemaker.model.ModelPackage` instance.
docstr_tok: ["Creates","a","model","package","for","creating","SageMaker","models","or","listing","on","Marketplace",".","Args",":","content_types","(","list","[","str","]","or","list","[","PipelineVariable","]",")",":","The","supported","MIME","types","for","the","input","data",".","response_types","(","list","[","str","]","or","list","[","PipelineVariable","]",")",":","The","supported","MIME","types","for","the","output","data",".","inference_instances","(","list","[","str","]","or","list","[","PipelineVariable","]",")",":","A","list","of","the","instance","types","that","are","used","to","generate","inferences","in","real-time","(","default",":","None",")",".","transform_instances","(","list","[","str","]","or","list","[","PipelineVariable","]",")",":","A","list","of","the","instance","types","on","which","a","transformation","job","can","be","run","or","on","which","an","endpoint","can","be","deployed","(","default",":","None",")",".","model_package_name","(","str","or","PipelineVariable",")",":","Model","Package","name",",","exclusive","to","`","model_package_group_name","`",",","using","`","model_package_name","`","makes","the","Model","Package","un-versioned","(","default",":","None",")",".","model_package_group_name","(","str","or","PipelineVariable",")",":","Model","Package","Group","name",",","exclusive","to","`","model_package_name","`",",","using","`","model_package_group_name","`","makes","the","Model","Package","versioned","(","default",":","None",")",".","image_uri","(","str","or","PipelineVariable",")",":","Inference","image","uri","for","the","container",".","Model","class","'","self.image","will","be","used","if","it","is","None","(","default",":","None",")",".","model_metrics","(","ModelMetrics",")",":","ModelMetrics","object","(","default",":","None",")",".","metadata_properties","(","MetadataProperties",")",":","MetadataProperties","object","(","default",":","None",")",".","marketplace_cert","(","bool",")",":","A","boolean","value","indicating","if","the","Model","Package","is","certified","for","AWS","Marketplace","(","default",":","False",")",".","approval_status","(","str","or","PipelineVariable",")",":","Model","Approval","Status",",","values","can","be","``","Approved","''",",","``","Rejected","''",",","or","``","PendingManualApproval","''","(","default",":","``","PendingManualApproval","''",")",".","description","(","str",")",":","Model","Package","description","(","default",":","None",")",".","drift_check_baselines","(","DriftCheckBaselines",")",":","DriftCheckBaselines","object","(","default",":","None",")",".","customer_metadata_properties","(","dict","[","str",",","str","]","or","dict","[","str",",","PipelineVariable","]",")",":","A","dictionary","of","key-value","paired","metadata","properties","(","default",":","None",")",".","domain","(","str","or","PipelineVariable",")",":","Domain","values","can","be","``","COMPUTER_VISION","''",",","``","NATURAL_LANGUAGE_PROCESSING","''",",","``","MACHINE_LEARNING","''","(","default",":","None",")",".","sample_payload_url","(","str","or","PipelineVariable",")",":","The","S3","path","where","the","sample","payload","is","stored","(","default",":","None",")",".","task","(","str","or","PipelineVariable",")",":","Task","values","which","are","supported","by","Inference","Recommender","are","``","FILL_MASK","''",",","``","IMAGE_CLASSIFICATION","''",",","``","OBJECT_DETECTION","''",",","``","TEXT_GENERATION","''",",","``","IMAGE_SEGMENTATION","''",",","``","CLASSIFICATION","''",",","``","REGRESSION","''",",","``","OTHER","''","(","default",":","None",")",".","framework","(","str","or","PipelineVariable",")",":","Machine","learning","framework","of","the","model","package","container","image","(","default",":","None",")",".","framework_version","(","str","or","PipelineVariable",")",":","Framework","version","of","the","Model","Package","Container","Image","(","default",":","None",")",".","nearest_model_name","(","str","or","PipelineVariable",")",":","Name","of","a","pre-trained","machine","learning","benchmarked","by","Amazon","SageMaker","Inference","Recommender","(","default",":","None",")",".","data_input_configuration","(","str","or","PipelineVariable",")",":","Input","object","for","the","model","(","default",":","None",")",".","skip_model_validation","(","str","or","PipelineVariable",")",":","Indicates","if","you","want","to","skip","model","validation",".","Values","can","be","``","All","''","or","``","None","''","(","default",":","None",")",".","Returns",":","A","`","sagemaker.model.ModelPackage","`","instance","."]
code: def register(
      self,
      content_types: List[Union[str, PipelineVariable]] = None,
      response_types: List[Union[str, PipelineVariable]] = None,
      inference_instances: Optional[
          List[Union[str, PipelineVariable]]
      ] = None,
      transform_instances: Optional[
          List[Union[str, PipelineVariable]]
      ] = None,
      model_package_name: Optional[Union[str, PipelineVariable]] = None,
      model_package_group_name: Optional[
          Union[str, PipelineVariable]
      ] = None,
      image_uri: Optional[Union[str, PipelineVariable]] = None,
      model_metrics: Optional[ModelMetrics] = None,
      metadata_properties: Optional[MetadataProperties] = None,
      marketplace_cert: bool = False,
      approval_status: Optional[Union[str, PipelineVariable]] = None,
      description: Optional[str] = None,
      drift_check_baselines: Optional[DriftCheckBaselines] = None,
      customer_metadata_properties: Optional[
          Dict[str, Union[str, PipelineVariable]]
      ] = None,
      domain: Optional[Union[str, PipelineVariable]] = None,
      sample_payload_url: Optional[Union[str, PipelineVariable]] = None,
      task: Optional[Union[str, PipelineVariable]] = None,
      framework: Optional[Union[str, PipelineVariable]] = None,
      framework_version: Optional[Union[str, PipelineVariable]] = None,
      nearest_model_name: Optional[Union[str, PipelineVariable]] = None,
      data_input_configuration: Optional[
          Union[str, PipelineVariable]
      ] = None,
      skip_model_validation: Optional[
          Union[str, PipelineVariable]
      ] = None,
  ):
      """Creates a model package for creating SageMaker models or listing on Marketplace.
  
      Args:
          content_types (list[str] or list[PipelineVariable]): The supported MIME types
              for the input data.
          response_types (list[str] or list[PipelineVariable]): The supported MIME types
              for the output data.
          inference_instances (list[str] or list[PipelineVariable]): A list of the
              instance types that are used to generate inferences in real-time (default: None).
          transform_instances (list[str] or list[PipelineVariable]): A list of the
              instance types on which a transformation job can be run or on which an
              endpoint can be deployed (default: None).
          model_package_name (str or PipelineVariable): Model Package name, exclusive to
              `model_package_group_name`, using `model_package_name` makes the Model Package
              un-versioned (default: None).
          model_package_group_name (str or PipelineVariable): Model Package Group name, exclusive
              to `model_package_name`, using `model_package_group_name` makes the Model Package
              versioned (default: None).
          image_uri (str or PipelineVariable): Inference image uri for the container.
              Model class' self.image will be used if it is None (default: None).
          model_metrics (ModelMetrics): ModelMetrics object (default: None).
          metadata_properties (MetadataProperties): MetadataProperties object (default: None).
          marketplace_cert (bool): A boolean value indicating if the Model Package is certified
              for AWS Marketplace (default: False).
          approval_status (str or PipelineVariable): Model Approval Status, values can be
              "Approved", "Rejected", or "PendingManualApproval"
              (default: "PendingManualApproval").
          description (str): Model Package description (default: None).
          drift_check_baselines (DriftCheckBaselines): DriftCheckBaselines object (default: None).
          customer_metadata_properties (dict[str, str] or dict[str, PipelineVariable]):
              A dictionary of key-value paired metadata properties (default: None).
          domain (str or PipelineVariable): Domain values can be "COMPUTER_VISION",
              "NATURAL_LANGUAGE_PROCESSING", "MACHINE_LEARNING" (default: None).
          sample_payload_url (str or PipelineVariable): The S3 path where the sample payload
              is stored (default: None).
          task (str or PipelineVariable): Task values which are supported by Inference Recommender
              are "FILL_MASK", "IMAGE_CLASSIFICATION", "OBJECT_DETECTION", "TEXT_GENERATION",
              "IMAGE_SEGMENTATION", "CLASSIFICATION", "REGRESSION", "OTHER" (default: None).
          framework (str or PipelineVariable): Machine learning framework of the model package
              container image (default: None).
          framework_version (str or PipelineVariable): Framework version of the Model Package
              Container Image (default: None).
          nearest_model_name (str or PipelineVariable): Name of a pre-trained machine learning
              benchmarked by Amazon SageMaker Inference Recommender (default: None).
          data_input_configuration (str or PipelineVariable): Input object for the model
              (default: None).
          skip_model_validation (str or PipelineVariable): Indicates if you want to skip model
              validation. Values can be "All" or "None" (default: None).
  
      Returns:
          A `sagemaker.model.ModelPackage` instance.
      """
      instance_type = (
          inference_instances[0] if inference_instances else None
      )
      self._init_sagemaker_session_if_does_not_exist(instance_type)
  
      if image_uri:
          self.image_uri = image_uri
      if not self.image_uri:
          self.image_uri = self.serving_image_uri(
              region_name=self.sagemaker_session.boto_session.region_name,
              instance_type=instance_type,
          )
      if not is_pipeline_variable(framework):
          framework = (framework or self._framework_name).upper()
      return super(PyTorchModel, self).register(
          content_types,
          response_types,
          inference_instances,
          transform_instances,
          model_package_name,
          model_package_group_name,
          image_uri,
          model_metrics,
          metadata_properties,
          marketplace_cert,
          approval_status,
          description,
          drift_check_baselines=drift_check_baselines,
          customer_metadata_properties=customer_metadata_properties,
          domain=domain,
          sample_payload_url=sample_payload_url,
          task=task,
          framework=framework,
          framework_version=framework_version or self.framework_version,
          nearest_model_name=nearest_model_name,
          data_input_configuration=data_input_configuration,
          skip_model_validation=skip_model_validation,
      )
  
imports: from __future__ import absolute_import
  import logging
  from typing import Optional, Union, List, Dict
  import packaging.version
  import sagemaker
  from sagemaker import image_uris, ModelMetrics
  from sagemaker.deserializers import NumpyDeserializer
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.fw_utils import model_code_key_prefix, python_deprecation_warning, validate_version_or_image_args
  from sagemaker.metadata_properties import MetadataProperties
  from sagemaker.model import FrameworkModel, MODEL_SERVER_WORKERS_PARAM_NAME
  from sagemaker.pytorch import defaults
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import NumpySerializer
  from sagemaker.utils import to_string
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 2 for calling the PyTorchModel obj's underlying member method code with example usage: obj.register(content_types, response_types, inference_instances, transform_instances, model_package_name, model_package_group_name, image_uri, model_metrics, metadata_properties, marketplace_cert, approval_status, description, drift_check_baselines, customer_metadata_properties, domain, sample_payload_url, task, framework, framework_version, nearest_model_name, data_input_configuration, skip_model_validation) and returns: super