sagemaker.serve.marshalling.triton_translator#

Implements class converts data from and to np.ndarray

Classes

ListTranslator()

Translate python list from and to numpy.ndarray

NumpyTranslator()

A dummy class to make sure the translator interface is aligned

TensorflowTensorTranslator()

Converts tf.Tensor from and to numpy.ndarray

TorchTensorTranslator()

Translate torch.Tensor from and to numpy.ndarray

class sagemaker.serve.marshalling.triton_translator.ListTranslator[source]#

Bases: object

Translate python list from and to numpy.ndarray

deserialize(data, content_type: str = 'application/x-npy')[source]#

Placeholder docstring

serialize(data, content_type: str = 'application/list')[source]#

Placeholder docstring

class sagemaker.serve.marshalling.triton_translator.NumpyTranslator[source]#

Bases: object

A dummy class to make sure the translator interface is aligned

deserialize(data, content_type: str = 'application/x-npy')[source]#

Placeholder docstring

serialize(data, content_type: str = 'application/x-npy')[source]#

Placeholder docstring

class sagemaker.serve.marshalling.triton_translator.TensorflowTensorTranslator[source]#

Bases: object

Converts tf.Tensor from and to numpy.ndarray

deserialize(data, content_type: str = 'application/x-npy')[source]#

Translate numpy ndarray to torch.Tensor

serialize(data, content_type: str = 'tensor/tf')[source]#

Translate tf.Tensor to numpy ndarray

class sagemaker.serve.marshalling.triton_translator.TorchTensorTranslator[source]#

Bases: object

Translate torch.Tensor from and to numpy.ndarray

deserialize(data, content_type: str = 'application/x-npy')[source]#

Translate numpy ndarray to torch.Tensor

serialize(data, content_type: str = 'tensor/pt')[source]#

Translate torch.Tensor to numpy ndarray