Ejemplo n.º 1
0
def xgboost_inference_request(inference_request: InferenceRequest) -> InferenceRequest:
    # Reshape to 2D array, matching the input data to xgboost_model
    single_input = inference_request.inputs[0]
    single_input.data = single_input.data = [[1, 2, 3]]

    # Keep only a single input
    inference_request.inputs = [single_input]

    return inference_request
Ejemplo n.º 2
0
def xgboost_inference_request(
        inference_request: InferenceRequest) -> InferenceRequest:
    # Reshape to 2D array, matching the input data to xgboost_model
    single_input = inference_request.inputs[0]
    single_input.data = TensorData.parse_obj([[1, 2, 3]])
    single_input.shape = [1, 3]

    # Keep only a single input
    inference_request.inputs = [single_input]

    return inference_request
Ejemplo n.º 3
0
def sklearn_inference_request(inference_request: InferenceRequest) -> InferenceRequest:
    # Keep only a single input
    inference_request.inputs = inference_request.inputs[:1]

    return inference_request
Ejemplo n.º 4
0
def test_first_input_decode(inference_request: InferenceRequest, expected: np.ndarray):
    inference_request.inputs = [inference_request.inputs[0]]
    first_input = NumpyRequestCodec.decode(inference_request)

    np.testing.assert_equal(first_input, expected)