Skip to content

Commit 71695c7

Browse files
ZhaoqiongZsvekars
andauthored
Fix code snippet format issue in inductor_windows (#3339)
Fix code snippet format issue in inductor_windows --------- Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent ccc02d6 commit 71695c7

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

prototype_source/inductor_windows.rst

+13-10
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,21 @@ Next, let's configure our environment.
4444
4545
"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"
4646
#. Create and activate a virtual environment: ::
47+
4748
#. Install `PyTorch 2.5 <https://pytorch.org/get-started/locally/>`_ or later for CPU Usage. Install PyTorch 2.7 or later refer to `Getting Started on Intel GPU <https://pytorch.org/docs/main/notes/get_start_xpu.html>`_ for XPU usage.
49+
4850
#. Here is an example of how to use TorchInductor on Windows:
49-
.. code-block:: python
50-
51-
import torch
52-
device="cpu" # or "xpu" for XPU
53-
def foo(x, y):
54-
a = torch.sin(x)
55-
b = torch.cos(x)
56-
return a + b
57-
opt_foo1 = torch.compile(foo)
58-
print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device)))
51+
52+
.. code-block:: python
53+
54+
import torch
55+
device="cpu" # or "xpu" for XPU
56+
def foo(x, y):
57+
a = torch.sin(x)
58+
b = torch.cos(x)
59+
return a + b
60+
opt_foo1 = torch.compile(foo)
61+
print(opt_foo1(torch.randn(10, 10).to(device), torch.randn(10, 10).to(device)))
5962
6063
#. Below is the output of the above example::
6164

0 commit comments

Comments
 (0)