class_docstr: Configures the compute resources for a Model.
docstr: Initializes a ResourceRequirements object for an Amazon SageMaker inference component.
  
  Args:
      requests (dict): Basic resource to be requested, including num_cpus, memory (in MB),
          accelerator_memory (in MB), copies.
      limits (dict): Max resource limit to be requested, including memory (in MB).
  
      Example:
          requests = {
               num_cpus: 1,
               memory: 1024,
               copies: 5
          },
          limits = {
              memory: 2048
          }
docstr_tok: ["Initializes","a","ResourceRequirements","object","for","an","Amazon","SageMaker","inference","component",".","Args",":","requests","(","dict",")",":","Basic","resource","to","be","requested",",","including","num_cpus",",","memory","(","in","MB",")",",","accelerator_memory","(","in","MB",")",",","copies",".","limits","(","dict",")",":","Max","resource","limit","to","be","requested",",","including","memory","(","in","MB",")",".","Example",":","requests","=","{","num_cpus",":","1",",","memory",":","1024",",","copies",":","5","}",",","limits","=","{","memory",":","2048","}"]
code: def __init__(
      self,
      requests: Optional[Dict[str, int]] = None,
      limits: Optional[Dict[str, int]] = None,
  ):
      """Initializes a ResourceRequirements object for an Amazon SageMaker inference component.
  
      Args:
          requests (dict): Basic resource to be requested, including num_cpus, memory (in MB),
              accelerator_memory (in MB), copies.
          limits (dict): Max resource limit to be requested, including memory (in MB).
  
          Example:
              requests = {
                   num_cpus: 1,
                   memory: 1024,
                   copies: 5
              },
              limits = {
                  memory: 2048
              }
      """
      self.requests = requests
      self.limits = limits
      self.num_accelerators: Optional[int] = None
      self.num_cpus: Optional[int] = None
      self.min_memory: Optional[int] = None
      self.max_memory: Optional[int] = None
      self.copy_count = 1
  
      if requests:
          if "num_accelerators" in requests:
              self.num_accelerators = requests["num_accelerators"]
          if "num_cpus" in requests:
              self.num_cpus = requests["num_cpus"]
          if "memory" in requests:
              self.min_memory = requests["memory"]
          if "copies" in requests:
              self.copy_count = requests["copies"]
      if limits:
          if "memory" in limits:
              self.max_memory = limits["memory"]
  
file_path: sagemaker-python-sdk/src/sagemaker/compute_resource_requirements/resource_requirements.py
imports: from __future__ import absolute_import
  import logging
  from typing import Optional, Dict
  from sagemaker.utils import stringify_object
label_desc: Use image node_id 1 to create a new ResourceRequirements object from inherited base classes: object with example: obj = ResourceRequirements(requests, limits)