From 731d51217a8d31c2320f0ca2946d317ea6e0aa2e Mon Sep 17 00:00:00 2001 From: LeeChanHyuk Date: Thu, 28 Jul 2022 09:37:45 +0900 Subject: [PATCH 1/4] Argument type error is fixed --- src/pytorch_lightning/profilers/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pytorch_lightning/profilers/base.py b/src/pytorch_lightning/profilers/base.py index b91f628013a33..dc1d0dc562e99 100644 --- a/src/pytorch_lightning/profilers/base.py +++ b/src/pytorch_lightning/profilers/base.py @@ -13,7 +13,7 @@ # limitations under the License. """Profiler to check if there are any bottlenecks in your code.""" from abc import ABC, abstractmethod -from typing import Any +from typing import Any, Optional from pytorch_lightning.profilers.profiler import Profiler from pytorch_lightning.utilities.rank_zero import rank_zero_deprecation @@ -57,7 +57,7 @@ class BaseProfiler(Profiler): Please use `Profiler` instead. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args: Optional[str], **kwargs: Optional[str]): rank_zero_deprecation( "`BaseProfiler` was deprecated in v1.6 and will be removed in v1.8. Please use `Profiler` instead." ) From 53629b0ca954c8910ef7bb320b0673d4ce0f00ad Mon Sep 17 00:00:00 2001 From: LeeChanHyuk Date: Thu, 28 Jul 2022 09:42:04 +0900 Subject: [PATCH 2/4] pyproject.toml is modified --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6d973aa0dde51..3ba8409b6ebf7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ module = [ "pytorch_lightning.demos.boring_classes", "pytorch_lightning.demos.mnist_datamodule", "pytorch_lightning.loggers.neptune", - "pytorch_lightning.profilers.base", "pytorch_lightning.profilers.pytorch", "pytorch_lightning.profilers.simple", "pytorch_lightning.strategies.ddp", From a3e1fdab40ffb38607a0fe46a380d019263cdb6a Mon Sep 17 00:00:00 2001 From: LeeChanHyuk Date: Thu, 28 Jul 2022 11:11:00 +0900 Subject: [PATCH 3/4] Argument error is fixed --- src/pytorch_lightning/profilers/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pytorch_lightning/profilers/base.py b/src/pytorch_lightning/profilers/base.py index dc1d0dc562e99..ac3e35041f403 100644 --- a/src/pytorch_lightning/profilers/base.py +++ b/src/pytorch_lightning/profilers/base.py @@ -13,7 +13,8 @@ # limitations under the License. """Profiler to check if there are any bottlenecks in your code.""" from abc import ABC, abstractmethod -from typing import Any, Optional +from typing import Any, Optional, Union +from pathlib import Path from pytorch_lightning.profilers.profiler import Profiler from pytorch_lightning.utilities.rank_zero import rank_zero_deprecation @@ -57,11 +58,11 @@ class BaseProfiler(Profiler): Please use `Profiler` instead. """ - def __init__(self, *args: Optional[str], **kwargs: Optional[str]): + def __init__(self, dirpath: Optional[Union[str, Path]], filename: Optional[str]): rank_zero_deprecation( "`BaseProfiler` was deprecated in v1.6 and will be removed in v1.8. Please use `Profiler` instead." ) - super().__init__(*args, **kwargs) + super().__init__(dirpath=dirpath, filename=filename) class PassThroughProfiler(Profiler): From 21c2bb2f13678df7c6055a492588544134a34bc5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 28 Jul 2022 02:12:59 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pytorch_lightning/profilers/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytorch_lightning/profilers/base.py b/src/pytorch_lightning/profilers/base.py index ac3e35041f403..1d3b670207f70 100644 --- a/src/pytorch_lightning/profilers/base.py +++ b/src/pytorch_lightning/profilers/base.py @@ -13,8 +13,8 @@ # limitations under the License. """Profiler to check if there are any bottlenecks in your code.""" from abc import ABC, abstractmethod -from typing import Any, Optional, Union from pathlib import Path +from typing import Any, Optional, Union from pytorch_lightning.profilers.profiler import Profiler from pytorch_lightning.utilities.rank_zero import rank_zero_deprecation