8000 fix file seperator paths for windows · pytorch/pytorch@e2513fd · GitHub
[go: up one dir, main page]

Skip to content < 8000 span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis">

Commit e2513fd

Browse files
fix file seperator paths for windows
1 parent 057ff99 commit e2513fd

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

torch/_dynamo/convert_frame.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ def _convert_frame_assert(
307307
return None
308308
if code.co_name == "<genexpr>" and code.co_filename.endswith(
309309
(
310-
"transformers/file_utils.py",
311-
"transformers/utils/generic.py",
312-
"diffusers/utils/outputs.py",
310+
"transformers/file_utils.py".replace("/", os.sep),
311+
"transformers/utils/generic.py".replace("/", os.sep),
312+
"diffusers/utils/outputs.py".replace("/", os.sep),
313313
)
314314
):
315315
# not needed, but cleans up torchbench error stats

torch/_dynamo/eval_frame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ def revert():
174174
DONT_WRAP_FILES = {
175175
# For tracing into fx modules
176176
inspect.getsourcefile(GraphModule),
177-
join(dirname(dirname(__file__)), "onnx/_internal/fx/dynamo_graph_extractor.py"),
177+
join(
178+
dirname(dirname(__file__)), "onnx/_internal/fx/dynamo_graph_extractor.py"
179+
).replace("/", os.sep),
178180
}
179181

180182

torch/_dynamo/skipfiles.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ def _module_dir(m: types.ModuleType):
235235
def get_legacy_mod_inlinelist():
236236
inlinelist = set()
237237
for m in LEGACY_MOD_INLINELIST:
238-
inlinelist.add(_module_dir(torch) + m[len("torch.") :].replace(".", "/"))
238+
inlinelist.add(_module_dir(torch) + m[len("torch.") :].replace(".", os.sep))
239239
return inlinelist
240240

241241

242242
@functools.lru_cache(None)
243243
def get_mod_inlinelist():
244244
inlinelist = set()
245245
for m in MOD_INLINELIST:
246-
inlinelist.add(_module_dir(torch) + m[len("torch.") :].replace(".", "/"))
246+
inlinelist.add(_module_dir(torch) + m[len("torch.") :].replace(".", os.sep))
247247
return inlinelist
248248

249249

@@ -261,9 +261,9 @@ def get_mod_inlinelist():
261261
# Skip fbcode paths(including torch.package paths) containing
262262
# one of the following strings.
263263
FBCODE_SKIP_DIRS = {
264-
"torchrec/distributed",
265-
"torchrec/fb/distributed",
266-
"caffe2/torch/fb/sparsenn/pooled_embeddings_modules.py",
264+
"torchrec/distributed".replace("/", os.sep),
265+
"torchrec/fb/distributed".replace("/", os.sep),
266+
"caffe2/torch/fb/sparsenn/pooled_embeddings_modules.py".replace("/", os.sep),
267267
}
268268
FBCODE_SKIP_DIRS_RE = re.compile(f".*({'|'.join(map(re.escape, FBCODE_SKIP_DIRS))})")
269269

0 commit comments

Comments
 (0)
0