class_docstr: Make async prediction requests to an Amazon SageMaker endpoint.
class_docstr_tok: ["Make","async","prediction","requests","to","an","Amazon","SageMaker","endpoint","."]
docstr: Return the Async Inference ouput Amazon S3 path from the specified endpoint.
  
  Args:
      data (object): Input data for which you want the model to provide
          inference. If a serializer was specified in the encapsulated
          Predictor object, the result of the serializer is sent as input
          data. Otherwise the data must be sequence of bytes, and the
          predict method then upload the data to the ``input_s3_path``. If
          ``input_s3_path`` is None, upload the data to
      input_path (str): Amazon S3 URI contains input data for which you want
          the model to provide async inference. (Default: None)
      initial_args (dict[str,str]): Optional. Default arguments for boto3
          ``invoke_endpoint_async`` call. (Default: None).
      inference_id (str): If you provide a value, it is added to the captured data
          when you enable data capture on the endpoint (Default: None).
  Raises:
      ValueError: If both input data and input Amazon S3 path are not provided
  Returns:
      AsyncInferenceResponse:
          Inference response for the given input. It provides method to check
          the result in the Amazon S3 output path.
docstr_tok: ["Return","the","Async","Inference","ouput","Amazon","S3","path","from","the","specified","endpoint",".","Args",":","data","(","object",")",":","Input","data","for","which","you","want","the","model","to","provide","inference",".","If","a","serializer","was","specified","in","the","encapsulated","Predictor","object",",","the","result","of","the","serializer","is","sent","as","input","data",".","Otherwise","the","data","must","be","sequence","of","bytes",",","and","the","predict","method","then","upload","the","data","to","the","``","input_s3_path","``",".","If","``","input_s3_path","``","is","None",",","upload","the","data","to","input_path","(","str",")",":","Amazon","S3","URI","contains","input","data","for","which","you","want","the","model","to","provide","async","inference",".","(","Default",":","None",")","initial_args","(","dict","[","str",",","str","]",")",":","Optional",".","Default","arguments","for","boto3","``","invoke_endpoint_async","``","call",".","(","Default",":","None",")",".","inference_id","(","str",")",":","If","you","provide","a","value",",","it","is","added","to","the","captured","data","when","you","enable","data","capture","on","the","endpoint","(","Default",":","None",")",".","Raises",":","ValueError",":","If","both","input","data","and","input","Amazon","S3","path","are","not","provided","Returns",":","AsyncInferenceResponse",":","Inference","response","for","the","given","input",".","It","provides","method","to","check","the","result","in","the","Amazon","S3","output","path","."]
code: def predict_async(
      self,
      data=None,
      input_path=None,
      initial_args=None,
      inference_id=None,
  ):
      """Return the Async Inference ouput Amazon S3 path from the specified endpoint.
  
      Args:
          data (object): Input data for which you want the model to provide
              inference. If a serializer was specified in the encapsulated
              Predictor object, the result of the serializer is sent as input
              data. Otherwise the data must be sequence of bytes, and the
              predict method then upload the data to the ``input_s3_path``. If
              ``input_s3_path`` is None, upload the data to
          input_path (str): Amazon S3 URI contains input data for which you want
              the model to provide async inference. (Default: None)
          initial_args (dict[str,str]): Optional. Default arguments for boto3
              ``invoke_endpoint_async`` call. (Default: None).
          inference_id (str): If you provide a value, it is added to the captured data
              when you enable data capture on the endpoint (Default: None).
      Raises:
          ValueError: If both input data and input Amazon S3 path are not provided
      Returns:
          AsyncInferenceResponse:
              Inference response for the given input. It provides method to check
              the result in the Amazon S3 output path.
      """
      if data is None and input_path is None:
          raise ValueError(
              "Please provide input data or input Amazon S3 location to use async prediction"
          )
      if data is not None:
          input_path = self._upload_data_to_s3(data, input_path)
  
      self._input_path = input_path
      response = self._submit_async_request(
          input_path, initial_args, inference_id
      )
      output_location = response["OutputLocation"]
      failure_location = response.get("FailureLocation")
      response_async = AsyncInferenceResponse(
          predictor_async=self,
          output_path=output_location,
          failure_path=failure_location,
      )
  
      return response_async
  
imports: from __future__ import absolute_import
  import threading
  import time
  import uuid
  from botocore.exceptions import WaiterError
  from sagemaker import s3
  from sagemaker.exceptions import PollingTimeoutError, AsyncInferenceModelError
  from sagemaker.async_inference import WaiterConfig, AsyncInferenceResponse
  from sagemaker.s3 import parse_s3_url
  from sagemaker.session import Session
  from sagemaker.utils import name_from_base, sagemaker_timestamp, format_tags
label_desc: Use image node_id 3 for calling the AsyncPredictor obj's underlying member method code with example usage: obj.predict_async(data, input_path, initial_args, inference_id) and returns: response_async