Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* fix pytorch#2343

* update docstring

* add comment

* fix docstrings

* remove trailing whitespace

Co-authored-by: vfdev <vfdev.5@gmail.com>
  • Loading branch information
2 people authored and Ishan-Kumar2 committed Dec 26, 2021
1 parent 53dd7d9 commit 29a28ca
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ignite/contrib/handlers/clearml_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class ClearMLLogger(BaseLogger):
kwargs: Keyword arguments accepted from
`clearml.Task
<https://clear.ml/docs/latest/docs/references/sdk/task#taskinit>`_.
All arguments are optional.
All arguments are optional. If a ClearML Task has already been created,
kwargs will be ignored and the current ClearML Task will be used.
Examples:
.. code-block:: python
Expand Down Expand Up @@ -147,12 +148,15 @@ def __setattr__(self, attr: str, val: Any) -> None:

self._task = _Stub()
else:
self._task = Task.init(
project_name=kwargs.get("project_name"),
task_name=kwargs.get("task_name"),
task_type=kwargs.get("task_type", Task.TaskTypes.training),
**experiment_kwargs,
)
# Try to retrieve current the ClearML Task before trying to create a new one
self._task = Task.current_task()
if self._task is None:
self._task = Task.init(
project_name=kwargs.get("project_name"),
task_name=kwargs.get("task_name"),
task_type=kwargs.get("task_type", Task.TaskTypes.training),
**experiment_kwargs,
)

self.clearml_logger = self._task.get_logger()

Expand Down

0 comments on commit 29a28ca

Please sign in to comment.