def default_input_fn()

in src/sagemaker_mxnet_serving_container/default_inference_handler.py [0:0]


    def default_input_fn(self, input_data, content_type):
        """Take request data and deserialize it into an MXNet NDArray for prediction.
        When an InvokeEndpoint operation is made against an Endpoint running SageMaker model server,
        the model server receives two pieces of information:

            - The request's content type, for example "application/json"
            - The request data

        The ``input_fn`` is responsible for preprocessing request data before prediction.

        Args:
            input_data (obj): the request data
            content_type (str): the request's content type

        Returns:
            mxnet.nd.array: an MXNet NDArray

        Raises:
            sagemaker_inference.errors.UnsupportedFormatError: if an unsupported content type is used.

        """
        if content_type in self.VALID_CONTENT_TYPES:
            np_array = decoder.decode(input_data, content_type)
            return mx.nd.array(np_array).as_in_context(get_default_context())
        else:
            raise errors.UnsupportedFormatError(content_type)