Commit f59dbb04 authored by Francisc Bungiu's avatar Francisc Bungiu Committed by Facebook GitHub Bot
Browse files

Fix empty context manager

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

In the current form, unit test fails with (https://fburl.com/ssrymti4)
```
 with get_monitoring_service():
E       AttributeError: __enter__
```
Return nullcontext to address.

Reviewed By: ynonaolga

Differential Revision: D48113440

fbshipit-source-id: 241d649e49c65ad778d999f7c25515dd72953bca
parent e82635eb
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import contextlib
import logging import logging
import os import os
from collections import OrderedDict from collections import OrderedDict
...@@ -170,7 +171,7 @@ def prepare_fb_model(cfg: CfgNode, model: torch.nn.Module) -> torch.nn.Module: ...@@ -170,7 +171,7 @@ def prepare_fb_model(cfg: CfgNode, model: torch.nn.Module) -> torch.nn.Module:
@fb_overwritable() @fb_overwritable()
def get_monitoring_service() -> Any: def get_monitoring_service() -> Any:
pass return contextlib.nullcontext()
class BaseRunner(object): class BaseRunner(object):
......
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