Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitDim support chns==1 #6086

Closed
wyli opened this issue Mar 1, 2023 · 0 comments · Fixed by #6090
Closed

SplitDim support chns==1 #6086

wyli opened this issue Mar 1, 2023 · 0 comments · Fixed by #6090

Comments

@wyli
Copy link
Contributor

wyli commented Mar 1, 2023

the error condition here is too restrictive:

if n_out <= 1:
raise RuntimeError(f"Input image is singleton along dimension to be split, got shape {img.shape}.")

e.g. single channel input works fine in numpy (and pytorch):

>>> a = np.zeros((1, 256, 256))
>>> s = np.split(a, 1, 0)
>>> len(s)
1

cc @holgerroth

wyli added a commit to wyli/MONAI that referenced this issue Mar 1, 2023
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli self-assigned this Mar 1, 2023
wyli added a commit to wyli/MONAI that referenced this issue Mar 1, 2023
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli closed this as completed in #6090 Mar 2, 2023
wyli added a commit that referenced this issue Mar 2, 2023
### Description
Fixes #6086 remove the channel check
Fixes #6087 internally using `float('nan')` to also represent
`"no_channel"`

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [x] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant