Skip to content

No GPU acceleration in torch backend #49

@CielAl

Description

@CielAl

Describe the bug
A clear and concise description of what the bug is.
It seems like all parameters of the torch-based normalizers are hard coded as tensors on CPUs and therefore there are no GPU acceleration at all unless one explicitly move the target, input, and all stain vectors to GPU devices.
Might be an easier way to fix this by making your torch normalizer also extend from torch.nn.Modules like all torchvision's transformation API does, and use register_buffer to store parameters and the whole normalizer object can be moved to specified device as whole.

To Reproduce
Steps to reproduce the behavior. Ideally a gist but a simple code example is also fine.

Expected behavior
A clear and concise description of what you expected to happen.

Logs
If applicable, add sufficient logs to assist in debugging the problem.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu, Windows, macOS]
  • Version [e.g. 20.04, 10, Catalina]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions