Skip to content

Commit d82e15c

Browse files
authored
Fix torchgen imports in codegen (#9310)
1 parent 7875be0 commit d82e15c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

codegen/lazy_tensor_generator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
from dataclasses import dataclass
55
from typing import List, Union
6+
7+
xla_root = sys.argv[1]
8+
torch_root = os.path.join(xla_root, "torch")
9+
10+
sys.path.insert(0, torch_root)
11+
612
from torchgen.api.lazy import LazyIrSchema
713
from torchgen.dest.lazy_ir import aten_symbol, node_ctor_inputs, GenLazyIR, GenLazyNativeFuncDefinition
814
from torchgen.gen_lazy_tensor import run_gen_lazy_tensor
@@ -15,8 +21,6 @@
1521
kernel_signature,
1622
)
1723

18-
xla_root = sys.argv[1]
19-
torch_root = os.path.join(xla_root, "torch")
2024
aten_path = os.path.join(torch_root, "aten", "src", "ATen")
2125
shape_inference_hdr = os.path.join(torch_root, "torch", "csrc", "lazy", "core",
2226
"shape_inference.h")

0 commit comments

Comments
 (0)