From 1e26f6c0d87d95676f6a3b8a7a060ca6f3df2f75 Mon Sep 17 00:00:00 2001 From: nninept Date: Fri, 22 Jul 2022 01:29:18 +0900 Subject: [PATCH 1/2] remove corresponding line from pyproject.toml --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index eb9b025e36811..a0960c58f6e6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,6 @@ module = [ "pytorch_lightning.demos.mnist_datamodule", "pytorch_lightning.loggers.comet", "pytorch_lightning.loggers.neptune", - "pytorch_lightning.profilers.advanced", "pytorch_lightning.profilers.base", "pytorch_lightning.profilers.pytorch", "pytorch_lightning.profilers.simple", From 85cb1e4a8a9f2e7a31efdf5ad420f1e1fee62af1 Mon Sep 17 00:00:00 2001 From: nninept Date: Fri, 22 Jul 2022 01:29:45 +0900 Subject: [PATCH 2/2] update __reduce__ function annotion --- src/pytorch_lightning/profilers/advanced.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pytorch_lightning/profilers/advanced.py b/src/pytorch_lightning/profilers/advanced.py index 214d67e52eb4c..90fddc8074168 100644 --- a/src/pytorch_lightning/profilers/advanced.py +++ b/src/pytorch_lightning/profilers/advanced.py @@ -17,7 +17,7 @@ import logging import pstats from pathlib import Path -from typing import Dict, Optional, Union +from typing import Dict, Optional, Tuple, Union from pytorch_lightning.profilers.profiler import Profiler @@ -82,7 +82,7 @@ def teardown(self, stage: Optional[str] = None) -> None: super().teardown(stage=stage) self.profiled_actions = {} - def __reduce__(self): + def __reduce__(self) -> Tuple: # avoids `TypeError: cannot pickle 'cProfile.Profile' object` return ( self.__class__,