Allow tests to be run on GPU with remote execution

Summary: Test path special case

Reviewed By: bottler

Differential Revision: D27566817

fbshipit-source-id: c7b3ac839908c071f1378a37b7013b91ca4e8b18
This commit is contained in:
Rong Rong (AI Infra)
2021-04-08 20:02:16 -07:00
committed by Facebook GitHub Bot
parent dd8343922e
commit c2e62a5087
2 changed files with 11 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import os
import unittest
from pathlib import Path
from typing import Callable, Optional, Union
@@ -19,8 +20,13 @@ def get_tests_dir() -> Path:
def get_pytorch3d_dir() -> Path:
"""
Returns Path for the root PyTorch3D directory.
Facebook internal systems need a special case here.
"""
return get_tests_dir().parent
if os.environ.get("INSIDE_RE_WORKER") is not None:
return Path(__file__).resolve().parent
else:
return Path(__file__).resolve().parent.parent
def load_rgb_image(filename: str, data_dir: Union[str, Path]):