-
Notifications
You must be signed in to change notification settings - Fork 1.4k
TileOnGrid support for Tensor input
#3384
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
Conversation
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
|
/build |
| from monai.utils import convert_data_type, convert_to_dst_type | ||
| from monai.utils.enums import TransformBackends | ||
|
|
||
| __all__ = ["SplitOnGrid", "TileOnGrid"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like SplitOnGrid(2, 2)(torch.arange(12).reshape(1, 3, 4)) works fine but SplitOnGrid(2, 2)(np.arange(12).reshape(1, 3, 4)) doesn't work, could you help fix it here? #3378 was merged too quickly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wyli, sorry I missed this. I will fix it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| x_size, y_size = self.tile_size, self.tile_size | ||
| c_len, x_len, y_len = image.shape | ||
| c_stride, x_stride, y_stride = image.strides | ||
| h_step, w_step = self.step, self.step |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the previous variable x_step is better than h_step, x indicates the axis direction, h indicates height which is the length of x direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can fix this too. sorry that I didn't see your comments before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #3379
Description
This PR updates
TileOnGridto supporttorch.Tensorthrough type conversion while the backend isnumpy. It also updates the unittests to includetorch.Tenorinputs on cpu and cuda device.Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.