def test_torch_inference(ckpt_path: Callable[[str], Path], monkeypatch: pytest.MonkeyPatch) -> None:
    """Tests Torch inference.

    Model is not trained as this checks that the inferencers are working.

    Args:
        ckpt_path: Callable[[str], Path]: Path to trained PADIM model checkpoint.
        monkeypatch: pytest fixture for patching environment variables.
    """
    # Set TRUST_REMOTE_CODE environment variable for the test
    monkeypatch.setenv("TRUST_REMOTE_CODE", "1")

    model = Padim()
    engine = Engine()
    export_root = ckpt_path("Padim").parent.parent
    engine.export(
        model=model,
        export_type=ExportType.TORCH,
        export_root=export_root,
        ckpt_path=str(ckpt_path("Padim")),
    )
    # Test torch inferencer
    torch_inferencer = TorchInferencer(
        path=export_root / "weights" / "torch" / "model.pt",
        device="cpu",
    )
    torch_dataloader = _MockImageLoader([256, 256], total_count=1)
    with torch.no_grad():
        for image in torch_dataloader():
            prediction = torch_inferencer.predict(image)
            assert 0.0 <= prediction.pred_score <= 1.0  # confirm if predicted scores are normalized
Tests Torch inference.

    Model is not trained as this checks that the inferencers are working.

    Args:
        ckpt_path: Callable[[str], Path]: Path to trained PADIM model checkpoint.
        monkeypatch: pytest fixture for patching environment variables.
    
tests/unit/deploy/test_inferencer.py