class_docstr: A mixin class for SageMaker ``Inference Recommender`` that will be extended by ``Model``
class_docstr_tok: ["A","mixin","class","for","SageMaker","``","Inference","Recommender","``","that","will","be","extended","by","``","Model","``"]
docstr: Validates that Inference Recommendation parameters can be used in `model.deploy()`
  
  Args:
      instance_type (str): The initial number of instances to run
          in the ``Endpoint`` created from this ``Model``. If not using
          serverless inference or the model has not called ``right_size()``,
          then it need to be a number larger or equals
          to 1 (default: None)
      initial_instance_count (int):The EC2 instance type to deploy this Model to.
          For example, 'ml.p2.xlarge', or 'local' for local mode. If not using
          serverless inference or the model has not called ``right_size()``,
          then it is required to deploy a model.
          (default: None)
      accelerator_type (str): whether accelerator_type has been passed into `model.deploy()`.
      serverless_inference_config (sagemaker.serverless.ServerlessInferenceConfig)):
          whether serverless_inference_config has been passed into `model.deploy()`.
      async_inference_config (sagemaker.model_monitor.AsyncInferenceConfig):
          whether async_inference_config has been passed into `model.deploy()`.
      explainer_config (sagemaker.explainer.ExplainerConfig): whether explainer_config
          has been passed into `model.deploy()`.
  
  Returns:
      (string, int) or None: Top instance_type and associated initial_instance_count
      if self.inference_recommender_job_results has been generated. Otherwise, return None.
docstr_tok: ["Validates","that","Inference","Recommendation","parameters","can","be","used","in","`","model.deploy","(",")","`","Args",":","instance_type","(","str",")",":","The","initial","number","of","instances","to","run","in","the","``","Endpoint","``","created","from","this","``","Model","``",".","If","not","using","serverless","inference","or","the","model","has","not","called","``","right_size","(",")","``",",","then","it","need","to","be","a","number","larger","or","equals","to","1","(","default",":","None",")","initial_instance_count","(","int",")",":","The","EC2","instance","type","to","deploy","this","Model","to",".","For","example",",","'ml.p2.xlarge","'",",","or","'local","'","for","local","mode",".","If","not","using","serverless","inference","or","the","model","has","not","called","``","right_size","(",")","``",",","then","it","is","required","to","deploy","a","model",".","(","default",":","None",")","accelerator_type","(","str",")",":","whether","accelerator_type","has","been","passed","into","`","model.deploy","(",")","`",".","serverless_inference_config","(","sagemaker.serverless.ServerlessInferenceConfig",")",")",":","whether","serverless_inference_config","has","been","passed","into","`","model.deploy","(",")","`",".","async_inference_config","(","sagemaker.model_monitor.AsyncInferenceConfig",")",":","whether","async_inference_config","has","been","passed","into","`","model.deploy","(",")","`",".","explainer_config","(","sagemaker.explainer.ExplainerConfig",")",":","whether","explainer_config","has","been","passed","into","`","model.deploy","(",")","`",".","Returns",":","(","string",",","int",")","or","None",":","Top","instance_type","and","associated","initial_instance_count","if","self.inference_recommender_job_results","has","been","generated",".","Otherwise",",","return","None","."]
code: def _update_params_for_right_size(
      self,
      instance_type=None,
      initial_instance_count=None,
      accelerator_type=None,
      serverless_inference_config=None,
      async_inference_config=None,
      explainer_config=None,
  ):
      """Validates that Inference Recommendation parameters can be used in `model.deploy()`
  
      Args:
          instance_type (str): The initial number of instances to run
              in the ``Endpoint`` created from this ``Model``. If not using
              serverless inference or the model has not called ``right_size()``,
              then it need to be a number larger or equals
              to 1 (default: None)
          initial_instance_count (int):The EC2 instance type to deploy this Model to.
              For example, 'ml.p2.xlarge', or 'local' for local mode. If not using
              serverless inference or the model has not called ``right_size()``,
              then it is required to deploy a model.
              (default: None)
          accelerator_type (str): whether accelerator_type has been passed into `model.deploy()`.
          serverless_inference_config (sagemaker.serverless.ServerlessInferenceConfig)):
              whether serverless_inference_config has been passed into `model.deploy()`.
          async_inference_config (sagemaker.model_monitor.AsyncInferenceConfig):
              whether async_inference_config has been passed into `model.deploy()`.
          explainer_config (sagemaker.explainer.ExplainerConfig): whether explainer_config
              has been passed into `model.deploy()`.
  
      Returns:
          (string, int) or None: Top instance_type and associated initial_instance_count
          if self.inference_recommender_job_results has been generated. Otherwise, return None.
      """
      if accelerator_type:
          raise ValueError(
              "accelerator_type is not compatible with right_size()."
          )
      if instance_type or initial_instance_count:
          logger.warning(
              "instance_type or initial_instance_count specified."
              "Overriding right_size() recommendations."
          )
          return None
      if async_inference_config:
          logger.warning(
              "async_inference_config is specified. Overriding right_size() recommendations."
          )
          return None
      if serverless_inference_config:
          logger.warning(
              "serverless_inference_config is specified. Overriding right_size() recommendations."
          )
          return None
      if explainer_config:
          logger.warning(
              "explainer_config is specified. Overriding right_size() recommendations."
          )
          return None
  
      return self._filter_recommendations_for_realtime()
  
imports: from __future__ import absolute_import
  import logging
  import re
  from typing import List, Dict, Optional
  import sagemaker
  from sagemaker.parameter import CategoricalParameter
label_desc: Use image node_id 3 for calling the InferenceRecommenderMixin obj's underlying member method code with example usage: obj._update_params_for_right_size(instance_type, initial_instance_count, accelerator_type, serverless_inference_config, async_inference_config, explainer_config) and returns: self, None, None, None, None