Repository: microsoft/hi-ml (language: python)

Issue:
ENH: Allow return of intermediate layers from ResNet
This PR allows the returning of intermediate layers for use as skip connections in e.g. U-Net by passing the argument "return_skip=True" during the forward pass.


Discussion / hints:
Thanks, @markpinnock. The mypy check is failing because you should explicitly annotate the return type with all the elements in the tuple. Something like this, assuming three tensors in the tuple:

```python
TypeSkipConnections = Tuple[torch.Tensor, torch.Tensor, torch.Tensor]
```

The notebook issue seems unrelated to this PR.
# [Codecov](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) Report
> Merging [#724](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) (995825f) into [main](https://codecov.io/gh/microsoft/hi-ml/commit/a5a18a8a926bc2237beb1916c480cbb0fbe35c88?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) (a5a18a8) will **increase** coverage by `1.90%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/microsoft/hi-ml/pull/724/graphs/tree.svg?width=650&height=150&src=pr&token=kMr2pSIJ2U&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft)](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft)

| Flag | Coverage Δ | |
|---|---|---|
| hi-ml-multimodal | `86.77% <100.00%> (+0.23%)` | :arrow_up: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | Coverage Δ | |
|---|---|---|
| [...imodal/src/health\_multimodal/image/model/resnet.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwtbXVsdGltb2RhbC9zcmMvaGVhbHRoX211bHRpbW9kYWwvaW1hZ2UvbW9kZWwvcmVzbmV0LnB5) | `100.00% <100.00%> (+3.70%)` | :arrow_up: |
| [hi-ml/src/health\_ml/utils/checkpoint\_handler.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwvc3JjL2hlYWx0aF9tbC91dGlscy9jaGVja3BvaW50X2hhbmRsZXIucHk=) | `92.10% <0.00%> (-6.34%)` | :arrow_down: |
| [...src/health\_cpath/configs/classification/BaseMIL.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwtY3BhdGgvc3JjL2hlYWx0aF9jcGF0aC9jb25maWdzL2NsYXNzaWZpY2F0aW9uL0Jhc2VNSUwucHk=) | `77.93% <0.00%> (-6.16%)` | :arrow_down: |
| [hi-ml-cpath/src/health\_cpath/utils/viz\_utils.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwtY3BhdGgvc3JjL2hlYWx0aF9jcGF0aC91dGlscy92aXpfdXRpbHMucHk=) | `84.34% <0.00%> (-2.12%)` | :arrow_down: |
| [hi-ml/src/health\_ml/utils/checkpoint\_utils.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwvc3JjL2hlYWx0aF9tbC91dGlscy9jaGVja3BvaW50X3V0aWxzLnB5) | `82.97% <0.00%> (-0.78%)` | :arrow_down: |
| [hi-ml-cpath/src/health\_cpath/utils/naming.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwtY3BhdGgvc3JjL2hlYWx0aF9jcGF0aC91dGlscy9uYW1pbmcucHk=) | `98.82% <0.00%> (-0.02%)` | :arrow_down: |
| [hi-ml/src/health\_ml/utils/\_\_init\_\_.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwvc3JjL2hlYWx0aF9tbC91dGlscy9fX2luaXRfXy5weQ==) | `100.00% <0.00%> (ø)` | |
| [hi-ml-azure/src/health\_azure/\_\_init\_\_.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwtYXp1cmUvc3JjL2hlYWx0aF9henVyZS9fX2luaXRfXy5weQ==) | `100.00% <0.00%> (ø)` | |
| [...i-ml-cpath/src/health\_cpath/utils/package\_setup.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwtY3BhdGgvc3JjL2hlYWx0aF9jcGF0aC91dGlscy9wYWNrYWdlX3NldHVwLnB5) | | |
| [...-ml-cpath/src/health\_cpath/utils/download\_utils.py](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#diff-aGktbWwtY3BhdGgvc3JjL2hlYWx0aF9jcGF0aC91dGlscy9kb3dubG9hZF91dGlscy5weQ==) | | |
| ... and [9 more](https://codecov.io/gh/microsoft/hi-ml/pull/724?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | |


Fix patch:
diff --git a/hi-ml-multimodal/.bumpversion.cfg b/hi-ml-multimodal/.bumpversion.cfg
new file mode 100644
index 000000000..6182627b6
--- /dev/null
+++ b/hi-ml-multimodal/.bumpversion.cfg
@@ -0,0 +1,8 @@
+[bumpversion]
+current_version = 0.1.2
+commit = True
+tag = False
+
+[bumpversion:file:setup.py]
+
+[bumpversion:file:src/health_multimodal/__init__.py]
diff --git a/hi-ml-multimodal/Makefile b/hi-ml-multimodal/Makefile
index 82aff7d17..82e63ef61 100644
--- a/hi-ml-multimodal/Makefile
+++ b/hi-ml-multimodal/Makefile
@@ -73,3 +73,13 @@ pyright:
 
 # run basic checks
 check: flake8 mypy pyright
+
+# bump version from specified part (major, minor or patch) (dry run). Usage:
+# $ make bump_version_dry part=patch
+bump_version_dry:
+	bump2version $(part) --verbose --dry-run --allow-dirty
+
+# bump version from specified part (major, minor or patch). Usage:
+# $ make bump_version part=patch
+bump_version:
+	bump2version $(part) --verbose
diff --git a/hi-ml-multimodal/setup.py b/hi-ml-multimodal/setup.py
index c1555d8c8..30dce0bfd 100644
--- a/hi-ml-multimodal/setup.py
+++ b/hi-ml-multimodal/setup.py
@@ -8,7 +8,7 @@
 
 
 long_description = Path("README.md").read_text(encoding="utf-8")
-version = "0.1.1"
+version = "0.1.2"
 package_name = "hi-ml-multimodal"
 install_requires = Path("requirements_run.txt").read_text().splitlines()
 
diff --git a/hi-ml-multimodal/src/health_multimodal/__init__.py b/hi-ml-multimodal/src/health_multimodal/__init__.py
index 9ceb8ec53..9d173701b 100644
--- a/hi-ml-multimodal/src/health_multimodal/__init__.py
+++ b/hi-ml-multimodal/src/health_multimodal/__init__.py
@@ -3,4 +3,4 @@
 #  Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
 #  -------------------------------------------------------------------------------------------
 
-__version__ = "0.1.1"
+__version__ = "0.1.2"


Test patch:
diff --git a/hi-ml-multimodal/requirements_test.txt b/hi-ml-multimodal/requirements_test.txt
index ede705738..7b29988d0 100644
--- a/hi-ml-multimodal/requirements_test.txt
+++ b/hi-ml-multimodal/requirements_test.txt
@@ -1,3 +1,4 @@
+bump2version==1.0.1
 coverage==6.3.2
 flake8==5.0.2
 ipykernel==6.15.0