"git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "806ca361c0d701e0269070e4d58be55e99d3b70e"
Commit 48b0fd16 authored by Miquel Jubert Hermoso's avatar Miquel Jubert Hermoso Committed by Facebook GitHub Bot
Browse files

Move utils/helper to OSS pattern 2

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/256

WTTS

Reviewed By: wat3rBro

Differential Revision: D36438057

fbshipit-source-id: 4d9bfda43d0263e3271b69172bf02f8f0b5d2663
parent 159115d8
......@@ -39,6 +39,7 @@ import detectron2.utils.comm as comm
import pkg_resources
import six
import torch
from d2go.utils.oss_helper import fb_overwritable
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config import get_cfg
from detectron2.data import MetadataCatalog
......@@ -75,6 +76,7 @@ class MultipleFunctionCallError(Exception):
pass
@fb_overwritable()
def run_once(
raise_on_multiple: bool = False,
# pyre-fixme[34]: `Variable[T]` isn't present in the function's parameters.
......@@ -107,6 +109,7 @@ def run_once(
return decorator
@fb_overwritable()
class retryable(object):
"""Fake retryable function"""
......@@ -117,8 +120,7 @@ class retryable(object):
return func
# pyre-fixme[3]: Return type must be annotated.
# pyre-fixme[2]: Parameter must be annotated.
@fb_overwritable()
def get_dir_path(relative_path):
"""Return a path for a directory in this package, extracting if necessary
......@@ -134,6 +136,7 @@ def get_dir_path(relative_path):
# copy util function for oss
@fb_overwritable()
def alias(x, name, is_backward=False):
if not torch.onnx.is_in_onnx_export():
return x
......@@ -141,6 +144,7 @@ def alias(x, name, is_backward=False):
return torch.ops._caffe2.AliasWithName(x, name, is_backward=is_backward)
@fb_overwritable()
class D2Trainer(DefaultTrainer):
@classmethod
def build_evaluator(cls, cfg, dataset_name, output_folder=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment