name: Bug Report
description: Report errors related to the book content or code
title: "Description"
labels: [bug]
assignees: rasbt
body:
  - type: markdown
    attributes:
      value: |
        Thank you for taking the time to report an issue. Please fill out the details below to help resolve it.

  - type: textarea
    id: bug_description
    attributes:
      label: Bug description
      description: A description of the issue.
      placeholder: |
        Please provide a description of what the bug or issue is.
    validations:
      required: true

  - type: dropdown
    id: operating_system
    attributes:
      label: What operating system are you using?
      description: If applicable, please select the operating system where you experienced this issue.
      options:
        - "Unknown"
        - "macOS"
        - "Linux"
        - "Windows"
    validations:
      required: False

  - type: dropdown
    id: compute_environment
    attributes:
      label: Where do you run your code?
      description: Please select the computing environment where you ran this code.
      options:
        - "Local (laptop, desktop)"
        - "Lightning AI Studio"
        - "Google Colab"
        - "Other cloud environment (AWS, Azure, GCP)"
    validations:
      required: False

  - type: textarea
    id: environment
    attributes:
      label: Environment
      description: |
        To help with debugging, please run the following code in a Jupyter
        notebook or Python script. Paste the output below or attach the generated
        `environment.txt` file.

        ```python
        import json, platform, subprocess, sys
        from importlib import metadata
        from pathlib import Path
        import torch

        def machine_model():
            try:
                if platform.system() == "Darwin":
                    raw = subprocess.check_output(
                        ["system_profiler", "SPHardwareDataType", "-json"], text=True
                    )
                    hw = json.loads(raw)["SPHardwareDataType"][0]
                    return f"{hw.get('machine_name')} ({hw.get('machine_model')}, {hw.get('chip_type')})"

                if platform.system() == "Linux":
                    paths = ["/sys/devices/virtual/dmi/id/sys_vendor",
                             "/sys/devices/virtual/dmi/id/product_name"]
                    return " ".join(Path(p).read_text().strip() for p in paths)

                if platform.system() == "Windows":
                    return subprocess.check_output(
                        ["powershell", "-NoProfile", "-Command",
                         "(Get-CimInstance Win32_ComputerSystem).Model"],
                        text=True,
                    ).strip()
            except Exception:
                pass
            return platform.machine()

        dist = metadata.distribution("torch")
        installer = (dist.read_text("INSTALLER") or "").strip()
        if not installer and (Path(sys.prefix) / "conda-meta").exists():
            installer = "conda"

        source = dist.read_text("direct_url.json")
        info = {
            "machine": machine_model(),
            "OS": platform.platform(),
            "architecture": platform.machine(),
            "Python": sys.version.split()[0],
            "PyTorch": torch.__version__,
            "installed_with": installer or "unknown",
            "installation_source": json.loads(source)["url"] if source else None,
            "CUDA_build": torch.version.cuda,
            "CUDA_available": torch.cuda.is_available(),
            "MPS_available": getattr(torch.backends, "mps", None) is not None
                             and torch.backends.mps.is_available(),
        }

        report = json.dumps(info, indent=2)
        print(report)
        Path("environment.txt").write_text(report)
        ```
      value: |
        ```



        ```
    validations:
      required: false
