"""Auto-generated stub for module: classification_runtime_adapters."""
from typing import Any, Tuple

from .eval_model_loader import load_model_with_runtime

# Functions
def allocate_buffers(engine: Any) -> tuple[Any, Any, Any, Any, Any]:
    """
    Create host and device buffers for TensorRT engine input/output.
    
        Args:
            engine: TensorRT engine object exposing tensor shapes.
            cuda: Imported PyCUDA driver module.
            trt: Imported TensorRT module.
    
        Returns:
            Tuple ``(h_input, d_input, h_output, d_output, stream)``.
    """
    ...
def do_inference(_engine: Any, context: Any, h_input: Any, d_input: Any, h_output: Any, d_output: Any, stream: Any) -> Any:
    """
    Run one TensorRT inference step and return host output buffer.
    
        Args:
            _engine: Unused TensorRT engine placeholder for API compatibility.
            context: TensorRT execution context.
            h_input: Host input buffer.
            d_input: Device input buffer.
            h_output: Host output buffer.
            d_output: Device output buffer.
            stream: CUDA stream used for async copies and execution.
            cuda: Imported PyCUDA driver module.
    
        Returns:
            Host output buffer containing inference results.
    """
    ...
def get_onnx_inference_results(loader: Any, model: Any, action_tracker: Any) -> tuple[Any.Any, Any.Any, Any.Any]:
    """
    Run classification inference for all batches on ONNX Runtime.
    
        Args:
            loader: Classification dataloader yielding ``(images, target)``.
            model: ONNX Runtime session object.
            action_tracker: Tracker-like object (unused in ONNX path).
    
        Returns:
            Tuple of concatenated ``(predictions, outputs, targets)`` tensors.
    """
    ...
def get_openvino_inference_results(loader: Any, model: tuple[Any, Any], action_tracker: Any) -> tuple[Any.Any, Any.Any, Any.Any]:
    """
    Run classification inference for all batches on OpenVINO runtime.
    
        Args:
            loader: Classification dataloader yielding ``(images, target)``.
            model: Tuple of ``(compiled_model, output_layer)`` objects.
            action_tracker: Tracker-like object (unused in OpenVINO path).
    
        Returns:
            Tuple of concatenated ``(predictions, outputs, targets)`` tensors.
    """
    ...
def get_pytorch_inference_results(loader: Any, model: Any, action_tracker: Any) -> tuple[Any.Any, Any.Any, Any.Any]:
    """
    Run classification inference for all batches on PyTorch runtime.
    
        Args:
            loader: Classification dataloader yielding ``(images, target)``.
            model: PyTorch or TorchScript module.
            action_tracker: Tracker-like object for optional inference logging.
    
        Returns:
            Tuple of concatenated ``(predictions, outputs, targets)`` tensors.
    """
    ...
def get_tensorrt_inference_results(loader: Any, model: tuple[Any, Any], action_tracker: Any) -> tuple[Any.Any, Any.Any, Any.Any]:
    """
    Run classification inference for all batches on TensorRT runtime.
    
        Args:
            loader: Classification dataloader yielding ``(images, target)``.
            model: Tuple of TensorRT ``(engine, context)`` objects.
            action_tracker: Tracker-like object (unused in TensorRT path).
    
        Returns:
            Tuple of concatenated ``(predictions, outputs, targets)`` tensors.
    """
    ...
def load_classification_model(action_tracker: Any, runtime_framework: str = 'pytorch') -> Any:
    """
    Load classification model artifact for the requested runtime.
    
        Args:
            action_tracker: Tracker-like object with model download methods.
            runtime_framework: Runtime descriptor used to select loader strategy.
    
        Returns:
            Runtime-specific loaded model artifact.
    """
    ...
def load_engine(trt_filename: str) -> tuple[Any, Any]:
    """
    Deserialize TensorRT engine file and build execution context.
    
        Args:
            trt_filename: Path to serialized TensorRT engine file.
            trt: Imported TensorRT module.
    
        Returns:
            Tuple of deserialized ``(engine, context)`` objects.
    """
    ...
def setup_tensorrt() -> tuple[Any, Any]:
    """
    Import TensorRT and PyCUDA lazily to keep base runtime lightweight.
    
        Args:
            None.
    
        Returns:
            Tuple of imported ``(cuda, trt)`` modules.
    """
    ...
def validate_device(loaded_model: Any.Any.Any) -> tuple[Any.Any.Any, Any.Any]:
    """
    Move model to best available device with safe CPU fallback.
    
        Args:
            loaded_model: PyTorch module to validate on target device.
    
        Returns:
            Tuple of ``(model_on_device, resolved_device)``.
    """
    ...
