class_docstr: Handle end-to-end training and deployment of custom RLEstimator code.
class_docstr_tok: ["Handle","end-to-end","training","and","deployment","of","custom","RLEstimator","code","."]
docstr: Create a SageMaker ``RLEstimatorModel`` object that can be deployed to an Endpoint.
  
  Args:
      role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``,
          which is also used during transform jobs. If not specified, the
          role from the Estimator will be used.
      vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on
          the model. Default: use subnets and security groups from this Estimator.
  
          * 'Subnets' (list[str]): List of subnet ids.
          * 'SecurityGroupIds' (list[str]): List of security group ids.
  
      entry_point (str): Path (absolute or relative) to the Python source
          file which should be executed as the entry point for MXNet
          hosting (default: self.entry_point). If ``source_dir`` is specified,
          then ``entry_point`` must point to a file located at the root of ``source_dir``.
      source_dir (str): Path (absolute or relative) to a directory with
          any other training source code dependencies aside from the entry
          point file (default: self.source_dir). Structure within this
          directory are preserved when hosting on Amazon SageMaker.
      dependencies (list[str]): A list of paths to directories (absolute
          or relative) with any additional libraries that will be exported
          to the container (default: self.dependencies). The library
          folders will be copied to SageMaker in the same folder where the
          entry_point is copied. If the ```source_dir``` points to S3,
          code will be uploaded and the S3 location will be used instead.
          This is not supported with "local code" in Local Mode.
      **kwargs: Additional kwargs passed to the :class:`~sagemaker.model.FrameworkModel`
          constructor.
  
  Returns:
      sagemaker.model.FrameworkModel: Depending on input parameters returns
          one of the following:
  
          * :class:`~sagemaker.model.FrameworkModel` - if ``image_uri`` is specified
              on the estimator;
          * :class:`~sagemaker.mxnet.MXNetModel` - if ``image_uri`` isn't specified and
              MXNet is used as the RL backend;
          * :class:`~sagemaker.tensorflow.model.TensorFlowModel` - if ``image_uri`` isn't
              specified and TensorFlow is used as the RL backend.
  
  Raises:
      ValueError: If image_uri is not specified and framework enum is not valid.
docstr_tok: ["Create","a","SageMaker","``","RLEstimatorModel","``","object","that","can","be","deployed","to","an","Endpoint",".","Args",":","role","(","str",")",":","The","``","ExecutionRoleArn","``","IAM","Role","ARN","for","the","``","Model","``",",","which","is","also","used","during","transform","jobs",".","If","not","specified",",","the","role","from","the","Estimator","will","be","used",".","vpc_config_override","(","dict","[","str",",","list","[","str","]","]",")",":","Optional","override","for","VpcConfig","set","on","the","model",".","Default",":","use","subnets","and","security","groups","from","this","Estimator",".","*","'Subnets","'","(","list","[","str","]",")",":","List","of","subnet","ids",".","*","'SecurityGroupIds","'","(","list","[","str","]",")",":","List","of","security","group","ids",".","entry_point","(","str",")",":","Path","(","absolute","or","relative",")","to","the","Python","source","file","which","should","be","executed","as","the","entry","point","for","MXNet","hosting","(","default",":","self.entry_point",")",".","If","``","source_dir","``","is","specified",",","then","``","entry_point","``","must","point","to","a","file","located","at","the","root","of","``","source_dir","``",".","source_dir","(","str",")",":","Path","(","absolute","or","relative",")","to","a","directory","with","any","other","training","source","code","dependencies","aside","from","the","entry","point","file","(","default",":","self.source_dir",")",".","Structure","within","this","directory","are","preserved","when","hosting","on","Amazon","SageMaker",".","dependencies","(","list","[","str","]",")",":","A","list","of","paths","to","directories","(","absolute","or","relative",")","with","any","additional","libraries","that","will","be","exported","to","the","container","(","default",":","self.dependencies",")",".","The","library","folders","will","be","copied","to","SageMaker","in","the","same","folder","where","the","entry_point","is","copied",".","If","the","``","`","source_dir","``","`","points","to","S3",",","code","will","be","uploaded","and","the","S3","location","will","be","used","instead",".","This","is","not","supported","with","``","local","code","''","in","Local","Mode",".","*","*","kwargs",":","Additional","kwargs","passed","to","the",":","class",":","`","~sagemaker.model.FrameworkModel","`","constructor",".","Returns",":","sagemaker.model.FrameworkModel",":","Depending","on","input","parameters","returns","one","of","the","following",":","*",":","class",":","`","~sagemaker.model.FrameworkModel","`","-","if","``","image_uri","``","is","specified","on","the","estimator",";","*",":","class",":","`","~sagemaker.mxnet.MXNetModel","`","-","if","``","image_uri","``","is","n't","specified","and","MXNet","is","used","as","the","RL","backend",";","*",":","class",":","`","~sagemaker.tensorflow.model.TensorFlowModel","`","-","if","``","image_uri","``","isn't","specified","and","TensorFlow","is","used","as","the","RL","backend",".","Raises",":","ValueError",":","If","image_uri","is","not","specified","and","framework","enum","is","not","valid","."]
code: def create_model(
      self,
      role=None,
      vpc_config_override=VPC_CONFIG_DEFAULT,
      entry_point=None,
      source_dir=None,
      dependencies=None,
      **kwargs,
  ):
      """Create a SageMaker ``RLEstimatorModel`` object that can be deployed to an Endpoint.
  
      Args:
          role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``,
              which is also used during transform jobs. If not specified, the
              role from the Estimator will be used.
          vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on
              the model. Default: use subnets and security groups from this Estimator.
  
              * 'Subnets' (list[str]): List of subnet ids.
              * 'SecurityGroupIds' (list[str]): List of security group ids.
  
          entry_point (str): Path (absolute or relative) to the Python source
              file which should be executed as the entry point for MXNet
              hosting (default: self.entry_point). If ``source_dir`` is specified,
              then ``entry_point`` must point to a file located at the root of ``source_dir``.
          source_dir (str): Path (absolute or relative) to a directory with
              any other training source code dependencies aside from the entry
              point file (default: self.source_dir). Structure within this
              directory are preserved when hosting on Amazon SageMaker.
          dependencies (list[str]): A list of paths to directories (absolute
              or relative) with any additional libraries that will be exported
              to the container (default: self.dependencies). The library
              folders will be copied to SageMaker in the same folder where the
              entry_point is copied. If the ```source_dir``` points to S3,
              code will be uploaded and the S3 location will be used instead.
              This is not supported with "local code" in Local Mode.
          **kwargs: Additional kwargs passed to the :class:`~sagemaker.model.FrameworkModel`
              constructor.
  
      Returns:
          sagemaker.model.FrameworkModel: Depending on input parameters returns
              one of the following:
  
              * :class:`~sagemaker.model.FrameworkModel` - if ``image_uri`` is specified
                  on the estimator;
              * :class:`~sagemaker.mxnet.MXNetModel` - if ``image_uri`` isn't specified and
                  MXNet is used as the RL backend;
              * :class:`~sagemaker.tensorflow.model.TensorFlowModel` - if ``image_uri`` isn't
                  specified and TensorFlow is used as the RL backend.
  
      Raises:
          ValueError: If image_uri is not specified and framework enum is not valid.
      """
      base_args = dict(
          model_data=self.model_data,
          role=role or self.role,
          image_uri=kwargs.get("image_uri", self.image_uri),
          container_log_level=self.container_log_level,
          sagemaker_session=self.sagemaker_session,
          vpc_config=self.get_vpc_config(vpc_config_override),
      )
  
      base_args["name"] = self._get_or_create_name(kwargs.get("name"))
  
      if not entry_point and (source_dir or dependencies):
          raise AttributeError("Please provide an `entry_point`.")
  
      entry_point = entry_point or self._model_entry_point()
      source_dir = source_dir or self._model_source_dir()
      dependencies = dependencies or self.dependencies
  
      extended_args = dict(
          entry_point=entry_point,
          source_dir=source_dir,
          code_location=self.code_location,
          dependencies=dependencies,
      )
      extended_args.update(base_args)
  
      if self.image_uri:
          return FrameworkModel(**extended_args)
  
      if self.toolkit == RLToolkit.RAY.value:
          raise NotImplementedError(
              "Automatic deployment of Ray models is not currently available."
              " Train policy parameters are available in model checkpoints"
              " in the TrainingJob output."
          )
  
      if self.framework == RLFramework.TENSORFLOW.value:
          return TensorFlowModel(
              framework_version=self.framework_version, **base_args
          )
      if self.framework == RLFramework.MXNET.value:
          return MXNetModel(
              framework_version=self.framework_version,
              py_version=PYTHON_VERSION,
              **extended_args,
          )
      raise ValueError(
          "An unknown RLFramework enum was passed in. framework: {}".format(
              self.framework
          )
      )
  
imports: from __future__ import absolute_import
  import enum
  import logging
  import re
  from typing import Union, Optional, List, Dict
  from sagemaker import image_uris, fw_utils
  from sagemaker.estimator import Framework, EstimatorBase
  from sagemaker.model import FrameworkModel, SAGEMAKER_OUTPUT_LOCATION
  from sagemaker.mxnet.model import MXNetModel
  from sagemaker.tensorflow.model import TensorFlowModel
  from sagemaker.vpc_utils import VPC_CONFIG_DEFAULT
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 2 for calling the RLEstimator obj's underlying member method code with example usage: obj.create_model(role, vpc_config_override, entry_point, source_dir, dependencies) and returns: FrameworkModel, TensorFlowModel, MXNetModel