def METHOD_NAME(self, requests):
    output0_dtype = self.output0_dtype
    output1_dtype = self.output1_dtype
    responses = []
    for request in requests:
        in_0 = pb_utils.get_input_tensor_by_name(request, "INPUT0")
        in_1 = pb_utils.get_input_tensor_by_name(request, "INPUT1")
        # If both of the tensors are in CPU, use NumPy.
        if in_0.is_cpu() and in_1.is_cpu():
            if (
                in_0.as_numpy().dtype.type is np.bytes_
                or in_0.as_numpy().dtype == np.object_
            ):
                out_0, out_1 = (
                    in_0.as_numpy().astype(np.int32)
                    + in_1.as_numpy().astype(np.int32),
                    in_0.as_numpy().astype(np.int32)
                    - in_1.as_numpy().astype(np.int32),
                )
                out_tensor_0 = pb_utils.Tensor(
                    "OUTPUT0", out_0.astype(output0_dtype)
                )
                out_tensor_1 = pb_utils.Tensor(
                    "OUTPUT1", out_1.astype(output1_dtype)
                )
            else:
                in_0_pytorch, in_1_pytorch = from_dlpack(
                    in_0.to_dlpack()
                ), from_dlpack(in_1.to_dlpack())
                out_0, out_1 = (
                    in_0_pytorch + in_1_pytorch,
                    in_0_pytorch - in_1_pytorch,
                )
                if self.output0_dtype == np.object_:
                    out_tensor_0 = pb_utils.Tensor(
                        "OUTPUT0", out_0.numpy().astype(output0_dtype)
                    )
                else:
                    out_0 = out_0.type(self.numpy_to_pytorch_dtype[output0_dtype])
                    out_tensor_0 = pb_utils.Tensor.from_dlpack(
                        "OUTPUT0", to_dlpack(out_0)
                    )
                if self.output1_dtype == np.object_:
                    out_tensor_1 = pb_utils.Tensor(
                        "OUTPUT1", out_1.numpy().astype(output1_dtype)
                    )
                else:
                    out_1 = out_1.type(self.numpy_to_pytorch_dtype[output1_dtype])
                    out_tensor_1 = pb_utils.Tensor.from_dlpack(
                        "OUTPUT1", to_dlpack(out_1)
                    )
        else:
            in_0_pytorch, in_1_pytorch = (
                from_dlpack(in_0.to_dlpack()).cuda(),
                from_dlpack(in_1.to_dlpack()).cuda(),
            )
            out_0, out_1 = (
                in_0_pytorch + in_1_pytorch,
                in_0_pytorch - in_1_pytorch,
            )
            out_tensor_0 = pb_utils.Tensor.from_dlpack("OUTPUT0", to_dlpack(out_0))
            out_tensor_1 = pb_utils.Tensor.from_dlpack("OUTPUT1", to_dlpack(out_1))
        responses.append(pb_utils.InferenceResponse([out_tensor_0, out_tensor_1]))
    return responses