PyTorchPredictor: A Predictor for inference against PyTorch Endpoints.

PyTorchPredictorR Documentation

A Predictor for inference against PyTorch Endpoints.

Description

This is able to serialize Python lists, dictionaries, and numpy arrays to multidimensional tensors for PyTorch inference.

Super classes

sagemaker.mlcore::PredictorBase -> sagemaker.mlcore::Predictor -> PyTorchPredictor

Methods

Public methods

Inherited methods

Method new()

Initialize an “PyTorchPredictor“.

Usage
PyTorchPredictor$new(
  endpoint_name,
  sagemaker_session = NULL,
  serializer = NumpySerializer$new(),
  deserializer = NumpyDeserializer$new()
)
Arguments
endpoint_name

(str): The name of the endpoint to perform inference on.

sagemaker_session

(sagemaker.session.Session): Session object which manages interactions with Amazon SageMaker APIs and any other AWS services needed. If not specified, the estimator creates one using the default AWS configuration chain.

serializer

(sagemaker.serializers.BaseSerializer): Optional. Default serializes input data to .npy format. Handles lists and numpy arrays.

deserializer

(sagemaker.deserializers.BaseDeserializer): Optional. Default parses the response from .npy format to numpy array.


Method clone()

The objects of this class are cloneable with this method.

Usage
PyTorchPredictor$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-mlframework documentation built on March 18, 2022, 7:41 a.m.