diff --git a/prototype_source/inductor_windows.rst b/prototype_source/inductor_windows.rst index ae1b454865e..1844e6d2735 100644 --- a/prototype_source/inductor_windows.rst +++ b/prototype_source/inductor_windows.rst @@ -44,18 +44,21 @@ Next, let's configure our environment. "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" #. Create and activate a virtual environment: :: + #. Install `PyTorch 2.5 `_ or later for CPU Usage. Install PyTorch 2.7 or later refer to `Getting Started on Intel GPU `_ for XPU usage. + #. Here is an example of how to use TorchInductor on Windows: -.. code-block:: python - - import torch - device="cpu" # or "xpu" for XPU - def foo(x, y): - a = torch.sin(x) - b = torch.cos(x) - return a + b - opt_foo1 = torch.compile(foo) - print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device))) + + .. code-block:: python + + import torch + device="cpu" # or "xpu" for XPU + def foo(x, y): + a = torch.sin(x) + b = torch.cos(x) + return a + b + opt_foo1 = torch.compile(foo) + print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device))) #. Below is the output of the above example::